Conditions | 6 |
Paths | 6 |
Total Lines | 27 |
Code Lines | 18 |
Lines | 14 |
Ratio | 51.85 % |
Changes | 0 |
1 | <?php |
||
33 | public function setLang() |
||
34 | { |
||
35 | if (Auth::check()) { |
||
36 | $user = Auth::user(); |
||
37 | |||
38 | // Set user locale |
||
39 | if ($user->locale) { |
||
40 | $this->setIfAllowed($user->locale); |
||
41 | View Code Duplication | } else { |
|
42 | if (config('localizer.set_auto_lang')) { |
||
43 | $this->setIfAllowed(Identify::lang()->getLanguage()); |
||
44 | } else { |
||
45 | $this->setIfAllowed(config('localizer.default_lang')); |
||
46 | } |
||
47 | } |
||
48 | } else { |
||
49 | if ($request->session()->has('locale')) { |
||
50 | $this->setIfAllowed(session('locale')); |
||
51 | View Code Duplication | } else { |
|
52 | if (config('localizer.set_auto_lang')) { |
||
53 | $this->setIfAllowed(Identify::lang()->getLanguage()); |
||
54 | } else { |
||
55 | $this->setIfAllowed(config('localizer.default_lang')); |
||
56 | } |
||
57 | } |
||
58 | } |
||
59 | } |
||
60 | |||
76 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.