Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | 31 | public static function version($number) |
|
8 | { |
||
9 | 31 | $version = (int) substr($number, 0, 1); |
|
10 | switch ($version) { |
||
11 | 31 | case 3: |
|
12 | 30 | return new Bootstrap3($number); |
|
13 | break; |
||
|
|||
14 | 1 | default: |
|
15 | 1 | throw new \Exception("Bootstrap version {$version} is not currently supported."); |
|
16 | 1 | } |
|
17 | } |
||
18 | } |
||
19 |
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.