| Conditions | 7 |
| Paths | 7 |
| Total Lines | 32 |
| Code Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | public function handle($request, Closure $next): RedirectResponse |
||
| 22 | { |
||
| 23 | if ($this->alreadyInstalled()) { |
||
| 24 | $installedRedirect = config('installer.installedAlreadyAction'); |
||
| 25 | |||
| 26 | switch ($installedRedirect) { |
||
| 27 | |||
| 28 | case 'route': |
||
| 29 | $routeName = config('installer.installed.redirectOptions.route.name'); |
||
| 30 | $data = config('installer.installed.redirectOptions.route.message'); |
||
| 31 | |||
| 32 | return redirect()->route($routeName)->with(['data' => $data]); |
||
| 33 | break; |
||
|
|
|||
| 34 | |||
| 35 | case 'abort': |
||
| 36 | abort(config('installer.installed.redirectOptions.abort.type')); |
||
| 37 | break; |
||
| 38 | |||
| 39 | case 'dump': |
||
| 40 | $dump = config('installer.installed.redirectOptions.dump.data'); |
||
| 41 | dd($dump); |
||
| 42 | break; |
||
| 43 | |||
| 44 | case '404': |
||
| 45 | case 'default': |
||
| 46 | default: |
||
| 47 | abort(404); |
||
| 48 | break; |
||
| 49 | } |
||
| 50 | } |
||
| 51 | |||
| 52 | return $next($request); |
||
| 53 | } |
||
| 65 |
The
breakstatement is not necessary if it is preceded for example by areturnstatement:If you would like to keep this construct to be consistent with other
casestatements, you can safely mark this issue as a false-positive.