Conditions | 4 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
25 | protected function validateBoolean(Node $node, string $functionName): void |
||
26 | { |
||
27 | if (!$node instanceof Literal || !\is_string($node->value)) { |
||
28 | throw InvalidBooleanException::forNonLiteralNode($node::class, $functionName); |
||
29 | } |
||
30 | |||
31 | $value = \strtolower(\trim((string) $node->value, "'\"")); |
||
32 | $lowercaseValue = \strtolower($value); |
||
33 | |||
34 | if (!$this->isValidBoolean($lowercaseValue)) { |
||
35 | throw InvalidBooleanException::forInvalidBoolean($value, $functionName); |
||
36 | } |
||
44 |