GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

OneSignalWebButton   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 87
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 0
dl 0
loc 87
ccs 19
cts 19
cp 1
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 4 1
A __construct() 0 4 1
A icon() 0 6 1
A text() 0 6 1
A url() 0 6 1
A toArray() 0 9 1
1
<?php
2
3
namespace NotificationChannels\OneSignal;
4
5
class OneSignalWebButton
6
{
7
    /** @var string */
8
    protected $id;
9
10
    /** @var string */
11
    protected $text;
12
13
    /** @var string */
14
    protected $icon;
15
16
    /** @var string */
17
    protected $url;
18
19
    /**
20
     * @param string $id
21
     *
22
     * @return static
23
     */
24 2
    public static function create($id)
25
    {
26 2
        return new static($id);
27
    }
28
29
    /**
30
     * @param string $id
31
     */
32 2
    public function __construct($id)
33
    {
34 2
        $this->id = $id;
35 2
    }
36
37
    /**
38
     * Set the message icon.
39
     *
40
     * @param string $value
41
     *
42
     * @return $this
43
     */
44 2
    public function icon($value)
45
    {
46 2
        $this->icon = $value;
47
48 2
        return $this;
49
    }
50
51
    /**
52
     * Set the message subject.
53
     *
54
     * @param string $value
55
     *
56
     * @return $this
57
     */
58 2
    public function text($value)
59
    {
60 2
        $this->text = $value;
61
62 2
        return $this;
63
    }
64
65
    /**
66
     * Set the message url.
67
     *
68
     * @param string $value
69
     *
70
     * @return $this
71
     */
72 2
    public function url($value)
73
    {
74 2
        $this->url = $value;
75
76 2
        return $this;
77
    }
78
79
    /**
80
     * @return array
81
     */
82 2
    public function toArray()
83
    {
84
        return [
85 2
            'id'   => $this->id,
86 2
            'text' => $this->text,
87 2
            'icon' => $this->icon,
88 2
            'url'  => $this->url,
89
        ];
90
    }
91
}
92