Conditions | 6 |
Paths | 5 |
Total Lines | 19 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
17 | 6 | public function handle(Request $request, Closure $next) |
|
18 | { |
||
19 | 6 | if ($request->is(...config('redirects.exclude', []))) { |
|
20 | 1 | return $next($request); |
|
21 | } |
||
22 | |||
23 | 5 | $path = urldecode($request->path()); |
|
24 | 5 | $redirect = app('redirect.model')->findValidOrNull($path); |
|
|
|||
25 | |||
26 | 5 | if (! $redirect && $request->getQueryString()) { |
|
27 | 1 | $path = $path.'?'.$request->getQueryString(); |
|
28 | 1 | $redirect = app('redirect.model')->findValidOrNull(urldecode($path)); |
|
29 | } |
||
30 | |||
31 | 5 | if ($redirect && $redirect->exists) { |
|
32 | 4 | return redirect($redirect->new_url, $redirect->status); |
|
33 | } |
||
34 | |||
35 | 2 | return $next($request); |
|
36 | } |
||
38 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.