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