| Conditions | 6 |
| Paths | 6 |
| Total Lines | 19 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 42 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 43 | public function getPlatform($platformName) { |
||
| 44 | switch ($platformName) { |
||
| 45 | case 'Darwin': |
||
| 46 | case 'FreeBSD': |
||
| 47 | case 'Linux': |
||
| 48 | return new LinuxPlatform($this->filesystem); |
||
| 49 | break; |
||
|
|
|||
| 50 | |||
| 51 | case 'WINNT': |
||
| 52 | case 'Windows': |
||
| 53 | return new WindowsPlatform($this->filesystem); |
||
| 54 | break; |
||
| 55 | |||
| 56 | default: |
||
| 57 | throw new PlatformException( |
||
| 58 | sprintf('Unsupported platform %s', PHP_OS), |
||
| 59 | PlatformException::CODE_UNKNOWN_PLATFORM); |
||
| 60 | } |
||
| 61 | } |
||
| 62 | } |
||
| 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.