Conditions | 6 |
Paths | 5 |
Total Lines | 17 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
24 | 12 | protected function compile($expr, Context $context) |
|
25 | { |
||
26 | 12 | $left = $context->getExpressionCompiler()->compile($expr->left); |
|
27 | 12 | $right = $context->getExpressionCompiler()->compile($expr->right); |
|
28 | |||
29 | 12 | if ($left->isTypeKnown() && $right->isTypeKnown()) { |
|
30 | 10 | if ($left->getValue() == $right->getValue()) { |
|
31 | 3 | return new CompiledExpression(CompiledExpression::INTEGER, 0); |
|
32 | 7 | } elseif ($left->getValue() < $right->getValue()) { |
|
33 | 3 | return new CompiledExpression(CompiledExpression::INTEGER, -1); |
|
34 | 4 | } elseif ($left->getValue() > $right->getValue()) { |
|
35 | 4 | return new CompiledExpression(CompiledExpression::INTEGER, 1); |
|
36 | } |
||
37 | } |
||
38 | |||
39 | 2 | return new CompiledExpression(); |
|
40 | } |
||
41 | } |
||
42 |