| Conditions | 6 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public function handle($request, Closure $next) |
||
| 20 | { |
||
| 21 | if (! $request->ajax()) { |
||
| 22 | $requestUri = $request->getRequestUri(); |
||
| 23 | $queryString = $request->getQueryString(); |
||
| 24 | $untrimmedPath = trim($request->getPathInfo(), '/').'/'; |
||
| 25 | |||
| 26 | if ($request->method() === 'GET' && mb_strrchr($requestUri, '.') === false && $this->checkQueryString($requestUri, $queryString)) { |
||
|
|
|||
| 27 | return redirect()->to($untrimmedPath.(! empty($queryString) ? '?'.$queryString : ''), 301); |
||
| 28 | } |
||
| 29 | } |
||
| 30 | |||
| 31 | return $next($request); |
||
| 32 | } |
||
| 33 | |||
| 45 |
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.