It seems like $builder->get() targeting Illuminate\Database\Eloquent\Builder::get() can also be of type array<integer,object<Ill...base\Eloquent\Builder>>; however, Sco\Admin\View\Tree::getTree() does only seem to accept object<Illuminate\Support\Collection>, maybe add an additional type check?
This check looks at variables that are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.
Loading history...
18
}
19
20
public function getTitleAttribute()
21
{
22
return $this->titleAttribute;
23
}
24
25
public function setTitleAttribute($value)
26
{
27
$this->titleAttribute = $value;
28
29
return $this;
30
}
31
32
public function getTree(Collection $collection)
33
{
34
if (is_null($key = $this->getTitleAttribute())) {
35
throw new InvalidArgumentException('Must set Tree title attribute');
36
}
37
38
return $collection->map(function ($row) use ($key) {
39
if (!isset($row->$key)) {
40
throw new \InvalidArgumentException("Not Found '{$key}' attribute");
This check looks at variables that are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.