1 | <?php |
||
54 | class IsEmpty implements Check |
||
55 | { |
||
56 | /** |
||
57 | * fluent-interface entry point |
||
58 | * |
||
59 | * we do not support any customisations |
||
60 | * |
||
61 | * @return IsEmpty |
||
62 | */ |
||
63 | public static function using() |
||
67 | |||
68 | /** |
||
69 | * check if an item is empty |
||
70 | * |
||
71 | * empty means one of: |
||
72 | * - item itself is empty |
||
73 | * - item is a data container, and only contains empty data items |
||
74 | * |
||
75 | * BE AWARE that this check WILL descend down into the contents of $fieldOrVar |
||
76 | * until it finds the first piece of non-empty data. This has the potential |
||
77 | * to be computationally expensive. |
||
78 | * |
||
79 | * @param mixed $fieldOrVar |
||
80 | * the item to check |
||
81 | * @return bool |
||
82 | * TRUE if the item is empty |
||
83 | * FALSE otherwise |
||
84 | */ |
||
85 | public static function check($fieldOrVar) |
||
110 | |||
111 | /** |
||
112 | * check if an item is empty |
||
113 | * |
||
114 | * empty means one of: |
||
115 | * - item itself has no content |
||
116 | * - item is a data container, and only contains empty data items |
||
117 | * |
||
118 | * BE AWARE that this check WILL descend down into the contents of $fieldOrVar |
||
119 | * until it finds the first piece of non-empty data. This has the potential |
||
120 | * to be computationally expensive. |
||
121 | * |
||
122 | * @param array $fieldOrVar |
||
123 | * the item to check |
||
124 | * @return bool |
||
125 | * TRUE if the item is empty |
||
126 | * FALSE otherwise |
||
127 | */ |
||
128 | private static function checkArray($fieldOrVar) |
||
136 | |||
137 | /** |
||
138 | * check if an item is empty |
||
139 | * |
||
140 | * empty means one of: |
||
141 | * - the string has zero length |
||
142 | * - the string only contains whitespace |
||
143 | * |
||
144 | * @param string $fieldOrVar |
||
145 | * the item to check |
||
146 | * @return bool |
||
147 | * TRUE if the item is empty |
||
148 | * FALSE otherwise |
||
149 | */ |
||
150 | private static function checkString($fieldOrVar) |
||
158 | |||
159 | /** |
||
160 | * check if an item is empty |
||
161 | * |
||
162 | * empty means one of: |
||
163 | * - item itself has no content |
||
164 | * - item is a data container, and only contains empty data items |
||
165 | * |
||
166 | * BE AWARE that this check WILL descend down into the contents of $fieldOrVar |
||
167 | * until it finds the first piece of non-empty data. This has the potential |
||
168 | * to be computationally expensive. |
||
169 | * |
||
170 | * @param array $fieldOrVar |
||
171 | * the item to check |
||
172 | * @return bool |
||
173 | * TRUE if the item is empty |
||
174 | * FALSE otherwise |
||
175 | */ |
||
176 | private static function checkTraversable($fieldOrVar) |
||
187 | |||
188 | /** |
||
189 | * check if an item is empty |
||
190 | * |
||
191 | * empty means one of: |
||
192 | * - item itself is empty |
||
193 | * - item is a data container, and only contains empty data items |
||
194 | * |
||
195 | * BE AWARE that this check WILL descend down into the contents of $fieldOrVar |
||
196 | * until it finds the first piece of non-empty data. This has the potential |
||
197 | * to be computationally expensive. |
||
198 | * |
||
199 | * @param mixed $fieldOrVar |
||
200 | * the item to check |
||
201 | * @return bool |
||
202 | * TRUE if the item is empty |
||
203 | * FALSE otherwise |
||
204 | */ |
||
205 | public function inspect($fieldOrVar) |
||
209 | } |
||
210 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: