1 | <?php |
||
5 | class ChabokMessage |
||
6 | { |
||
7 | /** @var string */ |
||
8 | protected $user; |
||
9 | |||
10 | /** @var string */ |
||
11 | protected $content; |
||
12 | |||
13 | /** @var array*/ |
||
14 | protected $data; |
||
15 | |||
16 | /** @var string */ |
||
17 | protected $trackId; |
||
18 | |||
19 | /** @var boolean */ |
||
20 | protected $inApp = false; |
||
21 | |||
22 | /** @var boolean */ |
||
23 | protected $live = false; |
||
24 | |||
25 | /** @var boolean */ |
||
26 | protected $useAsAlert = false; |
||
27 | |||
28 | /** @var string */ |
||
29 | protected $alertText; |
||
30 | |||
31 | /** @var integer */ |
||
32 | protected $ttl; |
||
33 | |||
34 | /** @var array*/ |
||
35 | protected $fallback; |
||
36 | |||
37 | /** @var string */ |
||
38 | protected $clientId; |
||
39 | |||
40 | /** @var array*/ |
||
41 | protected $notification; |
||
42 | |||
43 | /** @var boolean */ |
||
44 | protected $idr = false; |
||
45 | |||
46 | /** @var boolean */ |
||
47 | protected $silent = false; |
||
48 | |||
49 | /** @var string */ |
||
50 | protected $binary; |
||
51 | |||
52 | /** @var string */ |
||
53 | protected $type; |
||
54 | |||
55 | /** @var integer */ |
||
56 | protected $id; |
||
57 | |||
58 | /** |
||
59 | * @param string $user |
||
60 | * @return static |
||
61 | */ |
||
62 | 1 | public static function create($user = '') |
|
66 | |||
67 | /** |
||
68 | * @param string $user |
||
69 | */ |
||
70 | 20 | public function __construct($user = '') |
|
74 | |||
75 | /** |
||
76 | * Set the user. |
||
77 | * |
||
78 | * @param $user |
||
79 | * |
||
80 | * @return $this |
||
81 | */ |
||
82 | 1 | public function user($user) |
|
88 | |||
89 | /** |
||
90 | * Set the content. |
||
91 | * |
||
92 | * @param $content |
||
93 | * |
||
94 | * @return $this |
||
95 | */ |
||
96 | 2 | public function content($content) |
|
102 | |||
103 | /** |
||
104 | * Set the data. |
||
105 | * |
||
106 | * @param array $data |
||
107 | * |
||
108 | * @return $this |
||
109 | */ |
||
110 | 2 | public function data($data) |
|
116 | |||
117 | /** |
||
118 | * Set the trackId. |
||
119 | * |
||
120 | * @param $trackId |
||
121 | * |
||
122 | * @return $this |
||
123 | */ |
||
124 | 1 | public function trackId($trackId) |
|
130 | |||
131 | /** |
||
132 | * Set the inApp. |
||
133 | * |
||
134 | * @return $this |
||
135 | */ |
||
136 | 1 | public function inApp() |
|
142 | |||
143 | /** |
||
144 | * Set the live. |
||
145 | * |
||
146 | * @return $this |
||
147 | */ |
||
148 | 1 | public function live() |
|
154 | |||
155 | /** |
||
156 | * Set the useAsAlert. |
||
157 | * |
||
158 | * @param bool $title |
||
159 | * @return $this |
||
160 | */ |
||
161 | 2 | public function alert($title = true) |
|
171 | |||
172 | /** |
||
173 | * Set the ttl. |
||
174 | * |
||
175 | * @param $ttl |
||
176 | * |
||
177 | * @return $this |
||
178 | */ |
||
179 | 1 | public function ttl($ttl) |
|
185 | |||
186 | /** |
||
187 | * Set the fallback. |
||
188 | * |
||
189 | * @param array $fallback |
||
190 | * |
||
191 | * @return $this |
||
192 | */ |
||
193 | 1 | public function fallback($fallback) |
|
199 | |||
200 | /** |
||
201 | * Set the clientId. |
||
202 | * |
||
203 | * @param $clientId |
||
204 | * |
||
205 | * @return $this |
||
206 | */ |
||
207 | 1 | public function clientId($clientId) |
|
213 | |||
214 | /** |
||
215 | * Set the notification. |
||
216 | * |
||
217 | * @param array $notification |
||
218 | * |
||
219 | * @return $this |
||
220 | */ |
||
221 | 1 | public function notification($notification) |
|
227 | |||
228 | /** |
||
229 | * Set the idr. |
||
230 | * |
||
231 | * @return $this |
||
232 | */ |
||
233 | 1 | public function idr() |
|
239 | |||
240 | /** |
||
241 | * Set the silent. |
||
242 | * |
||
243 | * @return $this |
||
244 | */ |
||
245 | 1 | public function silent() |
|
251 | |||
252 | /** |
||
253 | * Set the binary. |
||
254 | * |
||
255 | * @param $binary |
||
256 | * |
||
257 | * @return $this |
||
258 | */ |
||
259 | 1 | public function binary($binary) |
|
265 | |||
266 | /** |
||
267 | * Set the type. |
||
268 | * |
||
269 | * @param $type |
||
270 | * |
||
271 | * @return $this |
||
272 | */ |
||
273 | 1 | public function type($type) |
|
279 | |||
280 | /** |
||
281 | * Set the id. |
||
282 | * |
||
283 | * @param $id |
||
284 | * |
||
285 | * @return $this |
||
286 | */ |
||
287 | 1 | public function id($id) |
|
293 | |||
294 | /** |
||
295 | * @return array |
||
296 | */ |
||
297 | 20 | public function toArray() |
|
353 | } |
||
354 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.