| Conditions | 7 |
| Paths | 13 |
| Total Lines | 23 |
| Code Lines | 16 |
| 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( |
||
| 35 | $left->getValue() << $expExpression->getValue() |
||
| 36 | ); |
||
| 37 | break; |
||
|
|
|||
| 38 | } |
||
| 39 | break; |
||
| 40 | } |
||
| 41 | |||
| 42 | return new CompiledExpression(CompiledExpression::UNKNOWN); |
||
| 43 | } |
||
| 44 | } |
||
| 45 |
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.