| Conditions | 6 |
| Paths | 6 |
| Total Lines | 19 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | public function getPlatform($platformName) { |
||
| 28 | switch ($platformName) { |
||
| 29 | case 'Darwin': |
||
| 30 | case 'FreeBSD': |
||
| 31 | case 'Linux': |
||
| 32 | return new LinuxPlatform(); |
||
| 33 | break; |
||
| 34 | |||
| 35 | case 'WINNT': |
||
| 36 | case 'Windows': |
||
| 37 | return new WindowsPlatform(); |
||
| 38 | break; |
||
| 39 | |||
| 40 | default: |
||
| 41 | throw new PlatformException( |
||
| 42 | sprintf('Unsupported platform %s', PHP_OS), |
||
| 43 | PlatformException::CODE_UNKNOWN_PLATFORM); |
||
| 44 | } |
||
| 45 | } |
||
| 46 | } |
||
| 47 |
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.