| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | public static function handle(ManipulatorInterface $image, array $params = []): ManipulatorInterface |
||
| 30 | { |
||
| 31 | if (false === isset($params['axis'])) { |
||
| 32 | throw new Exception('Param "axis" is required for action "Flip"'); |
||
| 33 | } |
||
| 34 | |||
| 35 | switch ($params['axis']) { |
||
| 36 | case 'horizontal': |
||
| 37 | return $image->flipHorizontally(); |
||
| 38 | break; |
||
|
|
|||
| 39 | case 'vertical': |
||
| 40 | return $image->flipVertically(); |
||
| 41 | break; |
||
| 42 | default: |
||
| 43 | throw new Exception('Param "axis" must be equal "horizontal" or "vertical" for action "Rotate"'); |
||
| 44 | break; |
||
| 45 | } |
||
| 46 | } |
||
| 47 | } |
||
| 48 |
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.