| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | public static function getResponse($exception) |
||
| 11 | { |
||
| 12 | switch ($exception) { |
||
| 13 | case ($exception instanceof NotFoundException): |
||
| 14 | return response()->view('errors.404', ['exception' => $exception], 404); |
||
| 15 | break; |
||
|
|
|||
| 16 | |||
| 17 | case ($exception instanceof NotSavedException): |
||
| 18 | return response()->view('errors.500', ['exception' => $exception], 500); |
||
| 19 | break; |
||
| 20 | |||
| 21 | case ($exception instanceof NotDeletedException): |
||
| 22 | return response()->view('errors.500', ['exception' => $exception], 500); |
||
| 23 | break; |
||
| 24 | } |
||
| 25 | |||
| 26 | return false; |
||
| 27 | } |
||
| 28 | } |
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.