This check compares calls to functions or methods with their respective definitions.
If the call has less arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the
check may pick up the wrong definition and report false positives. One codebase
where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.
Loading history...
19
}
20
21
/**
22
* @param Request $request
23
* @param Locale $locale
24
*
25
* @return string
26
*/
27
public function get(Request $request, Locale $locale): string
The expression return $this->detectPreferredLanguage() could return the type null which is incompatible with the type-hinted return string. Consider adding an additional type-check to rule them out.
This check compares calls to functions or methods with their respective definitions.
If the call has less arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the
check may pick up the wrong definition and report false positives. One codebase
where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.
Loading history...
30
}
31
32
/**
33
* @param Request $request
34
* @param Locale $locale
35
*
36
* @return string
37
*/
38
public function detectPreferredLanguage(Request $request, Locale $locale): string
The property available does not exist on mindtwo\LaravelMultilingual\Services\Locale. Since you implemented __get, consider adding a @property annotation.
The expression return $request->getPref...->available->toArray()) could return the type null which is incompatible with the type-hinted return string. Consider adding an additional type-check to rule them out.
This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.