| Conditions | 6 |
| Paths | 5 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 6.0208 |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | 11 | protected function compile($expr, Context $context) |
|
| 25 | { |
||
| 26 | 11 | $left = $context->getExpressionCompiler()->compile($expr->left); |
|
| 27 | 11 | $right = $context->getExpressionCompiler()->compile($expr->right); |
|
| 28 | |||
| 29 | 11 | if ($left->isTypeKnown() && $right->isTypeKnown()) { |
|
| 30 | 9 | if ($left->getValue() == $right->getValue()) { |
|
| 31 | 2 | 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 |