| Total Complexity | 13 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | final class Boolean |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * Determines if the value is `true`, otherwise it will return `false`. |
||
| 9 | * |
||
| 10 | * @param mixed $value |
||
| 11 | * |
||
| 12 | * @return bool |
||
| 13 | */ |
||
| 14 | 6 | public function isTrue($value): bool |
|
| 17 | } |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Determines if the value is `false`, otherwise it will return `true`. |
||
| 21 | * |
||
| 22 | * @param mixed $value |
||
| 23 | * |
||
| 24 | * @return bool |
||
| 25 | */ |
||
| 26 | 6 | public function isFalse($value): bool |
|
| 27 | { |
||
| 28 | 6 | return $value === false || $value === 0 || $value === '0' || $value === 'off' || $value === 'false'; |
|
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Converts a value to a boolean type. |
||
| 33 | * |
||
| 34 | * @param mixed $value |
||
| 35 | * |
||
| 36 | * @return bool |
||
| 37 | */ |
||
| 38 | 2 | public function to($value): bool |
|
| 49 | } |
||
| 50 | } |
||
| 51 |