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