| Conditions | 7 |
| Paths | 13 |
| Total Lines | 21 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 56 |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | protected function compile($expr, Context $context) |
||
| 22 | { |
||
| 23 | $left = $context->getExpressionCompiler()->compile($expr->var); |
||
| 24 | $expExpression = $context->getExpressionCompiler()->compile($expr->expr); |
||
| 25 | |||
| 26 | switch ($left->getType()) { |
||
| 27 | case CompiledExpression::INTEGER: |
||
| 28 | case CompiledExpression::DOUBLE: |
||
| 29 | case CompiledExpression::NUMBER: |
||
| 30 | switch ($expExpression->getType()) { |
||
| 31 | case CompiledExpression::INTEGER: |
||
| 32 | case CompiledExpression::DOUBLE: |
||
| 33 | case CompiledExpression::NUMBER: |
||
| 34 | return CompiledExpression::fromZvalValue($left->getValue() / $expExpression->getValue()); |
||
| 35 | break; |
||
|
|
|||
| 36 | } |
||
| 37 | break; |
||
| 38 | } |
||
| 39 | |||
| 40 | return new CompiledExpression(CompiledExpression::UNKNOWN); |
||
| 41 | } |
||
| 42 | } |
||
| 43 |
The break statement is not necessary if it is preceded for example by a return statement:
If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.