Conditions | 4 |
Paths | 4 |
Total Lines | 19 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4.0218 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | 4 | protected function compile($expr, Context $context) |
|
21 | { |
||
22 | 4 | $compiler = $context->getExpressionCompiler(); |
|
23 | |||
24 | 4 | if ($expr->name instanceof Node\Name) { |
|
25 | 4 | if ($expr->name->toString() === 'true') { |
|
26 | 3 | return new CompiledExpression(CompiledExpression::BOOLEAN, true); |
|
27 | } |
||
28 | |||
29 | 2 | if ($expr->name->toString() === 'false') { |
|
30 | return new CompiledExpression(CompiledExpression::BOOLEAN, false); |
||
31 | } |
||
32 | 2 | } |
|
33 | |||
34 | /** |
||
35 | * @todo Implement check |
||
36 | */ |
||
37 | 2 | return $compiler->compile($expr->name); |
|
38 | } |
||
39 | } |
||
40 |