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.
Completed
Push — master ( 6399ca...baf078 )
by Marcel
02:27
created

OneSignalButton::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

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