| Conditions | 8 |
| Paths | 8 |
| Total Lines | 23 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 18 |
| CRAP Score | 8 |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 26 | 9 | protected function compile($expr, Context $context) |
|
| 27 | { |
||
| 28 | 9 | $expression = new Expression($context); |
|
| 29 | 9 | $left = $expression->compile($expr->expr); |
|
| 30 | |||
| 31 | 9 | switch ($left->getType()) { |
|
| 32 | 9 | case CompiledExpression::INTEGER: |
|
| 33 | 9 | case CompiledExpression::DOUBLE: |
|
| 34 | 9 | case CompiledExpression::NUMBER: |
|
| 35 | 9 | case CompiledExpression::BOOLEAN: |
|
| 36 | 9 | case CompiledExpression::STRING: |
|
| 37 | 9 | case CompiledExpression::NULL: |
|
| 38 | 8 | return CompiledExpression::fromZvalValue(-$left->getValue()); |
|
| 39 | 1 | case CompiledExpression::ARR: |
|
| 40 | 1 | $context->notice( |
|
| 41 | 1 | 'unsupported-operand-types', |
|
| 42 | 1 | 'Unsupported operand types -{array}', |
|
| 43 | $expr |
||
| 44 | 1 | ); |
|
| 45 | 1 | } |
|
| 46 | |||
| 47 | 1 | return new CompiledExpression(); |
|
| 48 | } |
||
| 49 | } |
||
| 50 |