| Conditions | 4 |
| Paths | 4 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public static function guessDevice($manufactorId, $productId) { |
||
| 19 | |||
| 20 | switch ($manufactorId) { |
||
| 21 | case 1: |
||
| 22 | return self::getGarminDevice($productId); |
||
| 23 | break; |
||
|
|
|||
| 24 | case 23: |
||
| 25 | return self::getSuuntoDevice($productId); |
||
| 26 | break; |
||
| 27 | case 294: |
||
| 28 | return self::getCorosDevice($productId); |
||
| 29 | break; |
||
| 30 | default: |
||
| 31 | return null; |
||
| 32 | } |
||
| 33 | } |
||
| 34 | |||
| 52 |
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.