Conditions | 4 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4.0218 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | 26 | public function transform($value) |
|
26 | { |
||
27 | 26 | if ($value === null) { |
|
28 | return; |
||
29 | } |
||
30 | |||
31 | 26 | if (!is_bool($value)) { |
|
32 | 4 | throw new TransformationFailedException(sprintf( |
|
33 | 4 | 'The boolean type expects a boolean or null value, got "%s"', |
|
34 | 4 | is_object($value) ? get_class($value) : gettype($value) |
|
35 | 4 | )); |
|
36 | } |
||
37 | |||
38 | 22 | return $value; |
|
39 | } |
||
40 | |||
58 |