1 | <?php |
||
8 | class Search |
||
9 | { |
||
10 | protected $aspects = []; |
||
11 | |||
12 | /** |
||
13 | * @param string|\Spatie\Searchable\SearchAspect $searchAspect |
||
14 | * |
||
15 | * @return \Spatie\Searchable\Search |
||
16 | */ |
||
17 | public function registerAspect($searchAspect): self |
||
27 | |||
28 | public function registerModel(string $modelClass, ...$attributes): self |
||
44 | |||
45 | public function getSearchAspects(): array |
||
49 | |||
50 | public function search(string $query, ?User $user = null): SearchResultCollection |
||
54 | |||
55 | public function perform(string $query, ?User $user = null): SearchResultCollection |
||
66 | } |
||
67 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: