1 | <?php |
||
8 | class Packet extends Message |
||
9 | { |
||
10 | /** |
||
11 | * @var array |
||
12 | */ |
||
13 | protected $notification; |
||
14 | |||
15 | /** |
||
16 | * Set the notification. |
||
17 | * |
||
18 | * @param array $notification |
||
19 | * @return Message |
||
20 | */ |
||
21 | 1 | public function setNotification(array $notification) |
|
27 | |||
28 | /** |
||
29 | * To JSON |
||
30 | * Utility method to put the JSON into the |
||
31 | * GCM proper format for sending the message. |
||
32 | * |
||
33 | * @return string |
||
34 | */ |
||
35 | 1 | public function toJson() |
|
65 | } |
||
66 |
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.