($value)
| 2286 | } |
| 2287 | |
| 2288 | private static function boolFromMixed($value): bool |
| 2289 | { |
| 2290 | if (is_bool($value)) { |
| 2291 | return $value; |
| 2292 | } |
| 2293 | if (is_int($value) || is_float($value)) { |
| 2294 | return ((int)$value) !== 0; |
| 2295 | } |
| 2296 | $s = strtolower(trim((string)$value)); |
| 2297 | return in_array($s, ['1', 'true', 'yes', 'on'], true); |
| 2298 | } |
| 2299 | |
| 2300 | private static function intFromMixed($value, int $min = 0, int $max = 0): int |
| 2301 | { |
no outgoing calls
no test coverage detected