@@ 214-222 (lines=9) @@ | ||
211 | ); |
|
212 | } |
|
213 | break; |
|
214 | case 'int': |
|
215 | if (!is_int($value)) { |
|
216 | $details[] = sprintf( |
|
217 | 'Field "%s" must be int, but %s provided', |
|
218 | $key, |
|
219 | $value === null ? 'null' : gettype($value) |
|
220 | ); |
|
221 | } |
|
222 | break; |
|
223 | case 'float': |
|
224 | if (!is_float($value) && !is_int($value)) { |
|
225 | $details[] = sprintf( |
|
@@ 223-231 (lines=9) @@ | ||
220 | ); |
|
221 | } |
|
222 | break; |
|
223 | case 'float': |
|
224 | if (!is_float($value) && !is_int($value)) { |
|
225 | $details[] = sprintf( |
|
226 | 'Field "%s" must be float/double, but %s provided', |
|
227 | $key, |
|
228 | $value === null ? 'null' : gettype($value) |
|
229 | ); |
|
230 | } |
|
231 | break; |
|
232 | case 'bool': |
|
233 | if (!is_bool($value)) { |
|
234 | $details[] = sprintf( |
|
@@ 232-240 (lines=9) @@ | ||
229 | ); |
|
230 | } |
|
231 | break; |
|
232 | case 'bool': |
|
233 | if (!is_bool($value)) { |
|
234 | $details[] = sprintf( |
|
235 | 'Field "%s" must be boolean, but %s provided', |
|
236 | $key, |
|
237 | $value === null ? 'null' : gettype($value) |
|
238 | ); |
|
239 | } |
|
240 | break; |
|
241 | default: |
|
242 | $details[] = sprintf('Unknown type for "%s"', $key); |
|
243 | } |