1 | <?php |
||
18 | abstract class BaseThing extends BaseObject implements Arrayable, ThingInterface |
||
19 | { |
||
20 | use ThingTrait; |
||
21 | |||
22 | use ArrayableTrait { toArray as protected internalToArray; } |
||
23 | |||
24 | /** |
||
25 | * Contains the jsonLd definton @type value if not null or false. |
||
26 | * |
||
27 | * @return boolean|string Generates the @type field. |
||
28 | */ |
||
29 | public function typeDefintion() |
||
33 | |||
34 | /** |
||
35 | * Find all getter methods. |
||
36 | * |
||
37 | * @return array |
||
38 | */ |
||
39 | public function resolveGetterMethods() |
||
58 | |||
59 | /** |
||
60 | * @inheritdoc |
||
61 | */ |
||
62 | public function toArray(array $fields = [], array $expand = [], $recursive = true) |
||
72 | |||
73 | /** |
||
74 | * @inheritdoc |
||
75 | */ |
||
76 | public function fields() |
||
80 | |||
81 | /** |
||
82 | * Cleanup array from null values. |
||
83 | * |
||
84 | * @param array $haystack |
||
85 | * @return array |
||
86 | */ |
||
87 | private function removeEmptyValues(array $haystack) |
||
101 | } |
||
102 |
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.