1 | <?php |
||
14 | class Search |
||
15 | { |
||
16 | protected $index; |
||
17 | protected $query; |
||
18 | private $path; |
||
19 | private $limit = 25; |
||
20 | |||
21 | /** |
||
22 | * Search constructor. |
||
23 | * |
||
24 | * @param Index $index |
||
25 | * @param Query $query |
||
26 | */ |
||
27 | 3 | public function __construct(Index $index, Query $query) |
|
32 | |||
33 | /** |
||
34 | * @param $name |
||
35 | * @param $arguments |
||
36 | * @return $this |
||
37 | * @throws \BadMethodCallException |
||
38 | */ |
||
39 | public function __call($name, $arguments) |
||
52 | |||
53 | /** |
||
54 | * @param $limit |
||
55 | * @return $this |
||
56 | */ |
||
57 | 1 | public function limit($limit) |
|
62 | |||
63 | /** |
||
64 | * @param bool $path |
||
65 | * @return $this |
||
66 | */ |
||
67 | 1 | public function path($path = false) |
|
72 | |||
73 | /** |
||
74 | * @param $string |
||
75 | * @return $this |
||
76 | */ |
||
77 | 1 | public function raw($string) |
|
82 | |||
83 | /** |
||
84 | * @param $string |
||
85 | * @param bool $field |
||
86 | * @param null $offsets |
||
87 | * @return $this |
||
88 | * @return $this |
||
89 | */ |
||
90 | public function phrase($string, $field = false, $offsets = null) |
||
96 | |||
97 | /** |
||
98 | * @param $string |
||
99 | * @param bool $field |
||
100 | * @return $this |
||
101 | */ |
||
102 | public function fuzzy($string, $field = false) |
||
107 | |||
108 | /** |
||
109 | * @param $string |
||
110 | * @param bool $field |
||
111 | * @return Term |
||
112 | */ |
||
113 | protected function term($string, $field = false) |
||
117 | |||
118 | /** |
||
119 | * @param $string |
||
120 | * @param bool $field |
||
121 | * @param array $options |
||
122 | */ |
||
123 | public function wildcard($string, $field = false, $options = [ ]) |
||
127 | |||
128 | /** |
||
129 | * @param $string |
||
130 | * @param bool|string $field |
||
131 | * @return $this|bool |
||
132 | * @todo Work out why the search only works if the string is uppercase... |
||
133 | */ |
||
134 | public function where($string, $field = false) |
||
142 | |||
143 | /** |
||
144 | * @param array $terms |
||
145 | * @return $this |
||
146 | */ |
||
147 | public function multiTerm(array $terms) |
||
158 | |||
159 | /** |
||
160 | * @param $string |
||
161 | * @param array $array |
||
162 | * @return mixed |
||
163 | * @todo abstract this out |
||
164 | */ |
||
165 | private function mapWhereArray($string, array $array) |
||
173 | |||
174 | /** |
||
175 | * @param $string |
||
176 | * @param $field |
||
177 | * @return QueryTerm |
||
178 | */ |
||
179 | public function singleTerm($string, $field = false) |
||
183 | |||
184 | /** |
||
185 | * @return mixed |
||
186 | */ |
||
187 | public function hits() |
||
191 | |||
192 | /** |
||
193 | * @param array $array |
||
194 | * @return mixed |
||
195 | * @todo abstract this out |
||
196 | */ |
||
197 | private function mapIds(array $array) |
||
205 | } |
||
206 |
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: