It seems like hasRoute() must be provided by classes using this trait. How about adding it as abstract method to this trait?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
29
/** @scrutinizer ignore-call */
30
$route = $this->hasRoute($name);
Loading history...
30
if ($route) {
31
return $name;
32
}
33
return $this->initMvcRoute($name, $params);
34
}
35
36
/**
37
* @param $name
38
* @param array $params
39
* @return string
40
*/
41
protected function initMvcRoute($name, &$params = [])
42
{
43
$parts = explode(".", $name);
44
$count = count($parts);
45
if ($count > 3) {
46
return $name;
47
}
48
$firstPart = strtolower(reset($parts));
49
if (!in_array($firstPart, app('mvc.modules')->getNames())) {