Passed
Push — master ( a3961f...62f88c )
by Marcel
21:12
created

getPushoverEnabledUserTypes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 2
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\Settings;
4
5
class NotificationSettings extends AbstractSettings {
6
7 4
    public function getEmailEnabledUserTypes(): array {
8 4
        return $this->getValue('notifications.email.user_types', [ ]);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getValue('...l.user_types', array()) could return the type null which is incompatible with the type-hinted return array. Consider adding an additional type-check to rule them out.
Loading history...
9
    }
10
11
    public function setEmailEnabledUserTypes(array $userTypes): void {
12
        $this->setValue('notifications.email.user_types', $userTypes);
13
    }
14
15
    public function getPushoverEnabledUserTypes(): array {
16
        return $this->getValue('notifications.pushover.user_types', [ ]);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getValue('...r.user_types', array()) could return the type null which is incompatible with the type-hinted return array. Consider adding an additional type-check to rule them out.
Loading history...
17
    }
18
19
    public function setPushoverEnabledUserTypes(array $userTypes): void {
20
        $this->setValue('notifications.pushover.user_types', $userTypes);
21
    }
22
23
    public function getPushoverApiToken(): ?string {
24
        return $this->getValue('notifications.pushover.token', null);
25
    }
26
27
    public function setPushoverApiToken(?string $apiToken): void {
28
        $this->setValue('notifications.pushover.token', $apiToken);
29
    }
30
}