Total Complexity | 4 |
Total Lines | 25 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
13 | final class ConstantBooleanType extends BooleanType implements ConstantScalarType |
||
14 | { |
||
15 | /** @var bool */ |
||
16 | private $value; |
||
17 | |||
18 | 17 | public function __construct(bool $value) |
|
21 | 17 | } |
|
22 | |||
23 | 2 | public function describe() : string |
|
24 | { |
||
25 | 2 | if ($this->value === true) { |
|
26 | 2 | return 'true'; |
|
27 | } |
||
28 | |||
29 | 1 | return 'false'; |
|
30 | } |
||
31 | |||
32 | /** |
||
33 | * @param mixed $value |
||
34 | */ |
||
35 | 11 | public function validate($value) : bool |
|
38 | } |
||
39 | } |
||
40 |