| Conditions | 4 |
| Paths | 8 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 49 | public function handle($request, Closure $next) |
||
| 50 | { |
||
| 51 | if ($this->auth->check()) { |
||
| 52 | $language = (int) $this->auth->user()->language; |
||
| 53 | } |
||
| 54 | |||
| 55 | if (Cookie::has('language')) { |
||
| 56 | Config::set('app.locale', Cookie::get('language')); |
||
| 57 | app()->setLocale(Cookie::get('language')); |
||
| 58 | } |
||
| 59 | |||
| 60 | if ($request->session()->has('language')) { |
||
| 61 | Config::set('app.locale', $request->session()->get('language')); |
||
| 62 | app()->setLocale($request->session()->get('language')); |
||
| 63 | } |
||
| 64 | |||
| 65 | return $next($request); |
||
| 66 | } |
||
| 67 | } |
||
| 68 |
Adding a
@returnannotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.