| Conditions | 3 |
| Paths | 3 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 8 |
| Ratio | 42.11 % |
| 1 | <?php |
||
| 53 | public function handle($request, Closure $next) |
||
| 54 | { |
||
| 55 | $supportedLanguages = $request->getLanguages(); |
||
| 56 | $userLanguage = $this->config->get('app.locale'); |
||
| 57 | |||
| 58 | View Code Duplication | foreach ($supportedLanguages as $language) { |
|
| 59 | $language = str_replace('_', '-', $language); |
||
| 60 | |||
| 61 | if (isset($this->langs[$language])) { |
||
| 62 | $userLanguage = $language; |
||
| 63 | break; |
||
| 64 | } |
||
| 65 | } |
||
| 66 | |||
| 67 | app('translator')->setLocale($userLanguage); |
||
| 68 | Date::setLocale($userLanguage); |
||
| 69 | |||
| 70 | return $next($request); |
||
| 71 | } |
||
| 72 | } |
||
| 73 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..