| Total Complexity | 4 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class BoolDataField extends AbstractDataField implements DataFieldInterface |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @param string[] $trueValues |
||
| 11 | * @param string[] $falseValues |
||
| 12 | */ |
||
| 13 | 140 | public function __construct( |
|
| 14 | string $name, |
||
| 15 | private readonly array $trueValues = [], |
||
| 16 | private readonly array $falseValues = [], |
||
| 17 | private readonly bool $default = false |
||
| 18 | ) { |
||
| 19 | 140 | parent::__construct($name, $this->valueToBoolean(...)); |
|
| 20 | } |
||
| 21 | |||
| 22 | /** @param scalar $input */ |
||
| 23 | 120 | protected function valueToBoolean($input): bool |
|
| 33 | } |
||
| 34 | } |
||
| 35 |