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::icon()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 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