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 ( 518b4b...c517dc )
by Freek
10:02 queued 07:51
created

WebPushMessage::title()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace NotificationChannels\WebPush;
4
5
use Illuminate\Support\Arr;
6
7
class WebPushMessage
8
{
9
    /**
10
     * The notification id.
11
     *
12
     * @var string
13
     */
14
    protected $id = null;
15
16
    /**
17
     * The notification title.
18
     *
19
     * @var string
20
     */
21
    protected $title;
22
23
    /**
24
     * The notification body.
25
     *
26
     * @var string
27
     */
28
    protected $body;
29
30
    /**
31
     * The notification icon.
32
     *
33
     * @var string
34
     */
35
    protected $icon = null;
36
37
    /**
38
     * The notification actions.
39
     *
40
     * @var array
41
     */
42
    protected $actions = [];
43
44
    /**
45
     * @param string $body
46
     * @return static
47
     */
48
    public static function create($body = '')
49
    {
50
        return new static($body);
51
    }
52
53
    /**
54
     * @param string $body
55
     */
56
    public function __construct($body = '')
57
    {
58
        $this->title = '';
59
        $this->body = $body;
60
    }
61
62
    /**
63
     * Set the notification id.
64
     *
65
     * @param  string $value
66
     * @return $this
67
     */
68
    public function id($value)
69
    {
70
        $this->id = $value;
71
72
        return $this;
73
    }
74
75
    /**
76
     * Set the notification title.
77
     *
78
     * @param  string $value
79
     * @return $this
80
     */
81
    public function title($value)
82
    {
83
        $this->title = $value;
84
85
        return $this;
86
    }
87
88
    /**
89
     * Set the notification body.
90
     *
91
     * @param  string $value
92
     * @return $this
93
     */
94
    public function body($value)
95
    {
96
        $this->body = $value;
97
98
        return $this;
99
    }
100
101
    /**
102
     * Set the notification icon.
103
     *
104
     * @param  string $value
105
     * @return $this
106
     */
107
    public function icon($value)
108
    {
109
        $this->icon = $value;
110
111
        return $this;
112
    }
113
114
    /**
115
     * Set an action.
116
     *
117
     * @param  string $title
118
     * @param  string $action
119
     * @return $this
120
     */
121
    public function action($title, $action)
122
    {
123
        $this->actions[] = compact('title', 'action');
124
125
        return $this;
126
    }
127
128
    /**
129
     * Get an array representation of the message.
130
     *
131
     * @return array
132
     */
133
    public function toArray()
134
    {
135
        return [
136
            'id' => $this->id,
137
            'title' => $this->title,
138
            'body' => $this->body,
139
            'actions' => $this->actions,
140
            'icon' => $this->icon,
141
        ];
142
    }
143
}
144