Conditions | 5 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
30 | public static function assertBoolish($value): void |
||
31 | { |
||
32 | $normalizedValue = \mb_strtolower((string) $value); |
||
33 | if ($normalizedValue === 'false' || $normalizedValue === 'true') { |
||
34 | return; |
||
35 | } |
||
36 | |||
37 | if ($value === '1' || $value === '0') { |
||
38 | return; |
||
39 | } |
||
40 | |||
41 | throw Exceptions\InvalidArgument::invalidBooleanValue($value); |
||
42 | } |
||
44 |