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.

OneSignalButton::toArray()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace NotificationChannels\OneSignal;
4
5
class OneSignalButton
6
{
7
    /** @var string */
8
    protected $id;
9
10
    /** @var string */
11
    protected $text;
12
13
    /** @var string */
14
    protected $icon;
15
16
    /**
17
     * @param string $id
18
     *
19
     * @return static
20
     */
21 1
    public static function create($id)
22
    {
23 1
        return new static($id);
24
    }
25
26
    /**
27
     * @param string $id
28
     */
29 1
    public function __construct($id)
30
    {
31 1
        $this->id = $id;
32 1
    }
33
34
    /**
35
     * Set the message icon.
36
     *
37
     * @param string $value
38
     *
39
     * @return $this
40
     */
41 1
    public function icon($value)
42
    {
43 1
        $this->icon = $value;
44
45 1
        return $this;
46
    }
47
48
    /**
49
     * Set the message subject.
50
     *
51
     * @param string $value
52
     *
53
     * @return $this
54
     */
55 1
    public function text($value)
56
    {
57 1
        $this->text = $value;
58
59 1
        return $this;
60
    }
61
62
    /**
63
     * @return array
64
     */
65 1
    public function toArray()
66
    {
67
        return [
68 1
            'id'   => $this->id,
69 1
            'text' => $this->text,
70 1
            'icon' => $this->icon,
71
        ];
72
    }
73
}
74