1 | <?php |
||
7 | class Search |
||
8 | { |
||
9 | protected $aspects = []; |
||
10 | |||
11 | /** |
||
12 | * @param string|\Spatie\Searchable\SearchAspect $searchAspect |
||
13 | * |
||
14 | * @return \Spatie\Searchable\Search |
||
15 | */ |
||
16 | public function registerAspect($searchAspect): self |
||
26 | |||
27 | public function registerModel(string $modelClass, ...$attributes): self |
||
43 | |||
44 | public function getSearchAspects(): array |
||
48 | |||
49 | public function search(string $query, ?User $user = null): SearchResultCollection |
||
53 | |||
54 | public function perform(string $query, ?User $user = null): SearchResultCollection |
||
65 | } |
||
66 |
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: