| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 25 | public function handle($request, Closure $next) |
||
|
|
|||
| 26 | { |
||
| 27 | |||
| 28 | preg_match_all('/(\W|^)([a-z]{2})([^a-z]|$)/six', $request->server->get('HTTP_ACCEPT_LANGUAGE'), $m, PREG_PATTERN_ORDER); |
||
| 29 | |||
| 30 | $user_langs = $m[2]; |
||
| 31 | if (!empty($user_langs[0])) { |
||
| 32 | $total = Language::where('iso', '=', $user_langs[0])->count(); |
||
| 33 | if ($total > 0) { |
||
| 34 | return redirect()->to('/'.$user_langs[0]); |
||
| 35 | } |
||
| 36 | } |
||
| 37 | |||
| 38 | return redirect()->to('/fr'); |
||
| 39 | } |
||
| 40 | } |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.