1 | <?php |
||
15 | trait PayloadTrait |
||
16 | { |
||
17 | /** |
||
18 | * @var array |
||
19 | */ |
||
20 | private $payload = []; |
||
21 | |||
22 | /** |
||
23 | * @var array |
||
24 | */ |
||
25 | private $properties = []; |
||
26 | |||
27 | /** |
||
28 | * @var array |
||
29 | */ |
||
30 | private $methods = []; |
||
31 | |||
32 | /** |
||
33 | * @return array |
||
34 | */ |
||
35 | 3 | final public function payload() |
|
39 | |||
40 | /** |
||
41 | * @param array $payload |
||
42 | * @param array $required |
||
43 | * |
||
44 | * @throws PropertyException |
||
45 | */ |
||
46 | 12 | final protected function setPayload(array $payload, array $required = []) |
|
68 | |||
69 | /** |
||
70 | * @return array |
||
71 | */ |
||
72 | 10 | private function analyze() |
|
88 | } |
||
89 |
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.