| Total Complexity | 4 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class ToBoolean extends AbstractCollectionStrategy implements |
||
| 15 | StrategyInterface |
||
| 16 | { |
||
| 17 | public function extract(mixed $value, object|null $object = null): bool|null |
||
| 18 | { |
||
| 19 | if ($value === null) { |
||
| 20 | // @codeCoverageIgnoreStart |
||
| 21 | return $value; |
||
| 22 | // @codeCoverageIgnoreEnd |
||
| 23 | } |
||
| 24 | |||
| 25 | return (bool) $value; |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @param mixed[]|null $data |
||
| 30 | * |
||
| 31 | * @codeCoverageIgnore |
||
| 32 | */ |
||
| 33 | public function hydrate(mixed $value, array|null $data): bool|null |
||
| 40 | } |
||
| 41 | } |
||
| 42 |