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