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