| 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 |
||
| 44 | public function getPlatform($platformName) { |
||
| 45 | switch ($platformName) { |
||
| 46 | case 'Darwin': |
||
| 47 | case 'FreeBSD': |
||
| 48 | case 'Linux': |
||
| 49 | return new LinuxPlatform($this->filesystem); |
||
| 50 | break; |
||
| 51 | |||
| 52 | case 'WINNT': |
||
| 53 | case 'Windows': |
||
| 54 | return new WindowsPlatform($this->filesystem); |
||
| 55 | break; |
||
| 56 | |||
| 57 | default: |
||
| 58 | throw new PlatformException( |
||
| 59 | sprintf('Unsupported platform %s', PHP_OS), |
||
| 60 | PlatformException::CODE_UNKNOWN_PLATFORM); |
||
| 61 | } |
||
| 62 | } |
||
| 63 | } |
||
| 64 |
This check compares the return type specified in the
@returnannotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.