| Conditions | 5 |
| Paths | 7 |
| Total Lines | 21 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 17 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | 48 | protected function compile($expr, Context $context) |
|
| 29 | { |
||
| 30 | 48 | $left = $context->getExpressionCompiler()->compile($expr->left); |
|
| 31 | 48 | $right = $context->getExpressionCompiler()->compile($expr->right); |
|
| 32 | |||
| 33 | 48 | switch ($left->getType()) { |
|
| 34 | 48 | case CompiledExpression::INTEGER: |
|
| 35 | 48 | case CompiledExpression::DOUBLE: |
|
| 36 | 44 | switch ($right->getType()) { |
|
| 37 | 44 | case CompiledExpression::INTEGER: |
|
| 38 | 44 | case CompiledExpression::DOUBLE: |
|
| 39 | 40 | return new CompiledExpression( |
|
| 40 | 40 | CompiledExpression::BOOLEAN, |
|
| 41 | 40 | $this->compare($left->getValue(), $right->getValue()) |
|
| 42 | 40 | ); |
|
| 43 | 4 | } |
|
| 44 | 4 | break; |
|
| 45 | 8 | } |
|
| 46 | |||
| 47 | 8 | return new CompiledExpression(CompiledExpression::BOOLEAN); |
|
| 48 | } |
||
| 49 | } |
||
| 50 |