1 | <?php |
||
18 | class Search |
||
19 | { |
||
20 | protected $index; |
||
21 | protected $query; |
||
22 | private $path; |
||
23 | private $limit = 25; |
||
24 | |||
25 | /** |
||
26 | * Search constructor. |
||
27 | * |
||
28 | * @param Index $index |
||
29 | * @param Query $query |
||
30 | */ |
||
31 | 3 | public function __construct(Index $index, Query $query) |
|
36 | |||
37 | /** |
||
38 | * @param $name |
||
39 | * @param $arguments |
||
40 | * @return $this |
||
41 | * @throws \BadMethodCallException |
||
42 | */ |
||
43 | public function __call($name, $arguments) |
||
56 | |||
57 | /** |
||
58 | * @param $limit |
||
59 | * @return $this |
||
60 | */ |
||
61 | 1 | public function limit($limit) |
|
66 | |||
67 | /** |
||
68 | * @param bool $path |
||
69 | * @return $this |
||
70 | */ |
||
71 | 1 | public function path($path = false) |
|
76 | |||
77 | /** |
||
78 | * @param $string |
||
79 | * @return $this |
||
80 | */ |
||
81 | 1 | public function raw($string) |
|
86 | |||
87 | /** |
||
88 | * @param $string |
||
89 | * @param bool $field |
||
90 | * @param null $offsets |
||
91 | * @return $this |
||
92 | * @return $this |
||
93 | */ |
||
94 | public function phrase($string, $field = false, $offsets = null) |
||
100 | |||
101 | /** |
||
102 | * @param $string |
||
103 | * @param bool $field |
||
104 | * @return $this |
||
105 | */ |
||
106 | public function fuzzy($string, $field = false) |
||
111 | |||
112 | /** |
||
113 | * @param $string |
||
114 | * @param bool $field |
||
115 | * @return Term |
||
116 | */ |
||
117 | protected function term($string, $field = false) |
||
121 | |||
122 | /** |
||
123 | * @param $string |
||
124 | * @param bool $field |
||
125 | * @param array $options |
||
126 | */ |
||
127 | public function wildcard($string, $field = false, $options = [ ]) |
||
131 | |||
132 | /** |
||
133 | * @param $string |
||
134 | * @param bool|string $field |
||
135 | * @return $this|bool |
||
136 | * @todo Work out why the search only works if the string is uppercase... |
||
137 | */ |
||
138 | public function where($string, $field = false) |
||
146 | |||
147 | /** |
||
148 | * @param array $terms |
||
149 | * @return $this |
||
150 | */ |
||
151 | public function multiTerm(array $terms) |
||
162 | |||
163 | /** |
||
164 | * @param $string |
||
165 | * @param array $array |
||
166 | * @return mixed |
||
167 | * @todo abstract this out |
||
168 | */ |
||
169 | private function mapWhereArray($string, array $array) |
||
177 | |||
178 | /** |
||
179 | * @param $string |
||
180 | * @param $field |
||
181 | * @return QueryTerm |
||
182 | */ |
||
183 | public function singleTerm($string, $field = false) |
||
187 | |||
188 | /** |
||
189 | * @return mixed |
||
190 | */ |
||
191 | public function hits() |
||
197 | |||
198 | /** |
||
199 | * @param array $array |
||
200 | * @return mixed |
||
201 | * @todo abstract this out |
||
202 | */ |
||
203 | private function mapIds(array $array) |
||
211 | } |
||
212 |
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: