| Conditions | 7 |
| Paths | 4 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 7 |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | 51 | public function normalize(mixed $options, mixed $value): string |
|
| 8 | { |
||
| 9 | 51 | if ($this->nullable && empty($value) && !\is_bool($value)) { |
|
| 10 | 2 | return ''; |
|
| 11 | } |
||
| 12 | 51 | if (\is_bool($value)) { |
|
| 13 | 35 | return $this->whichResult($value); |
|
| 14 | } |
||
| 15 | 18 | if (\is_string($value)) { |
|
| 16 | 17 | return $this->whichResult(!empty($value) && 'false' !== \strtolower($value)); |
|
| 17 | } |
||
| 18 | 1 | return $this->whichResult(!empty($value)); |
|
| 19 | } |
||
| 26 |