1 | <?php |
||
49 | class SearchService { |
||
50 | |||
51 | |||
52 | use TArrayTools; |
||
53 | |||
54 | |||
55 | /** @var SearchMappingService */ |
||
56 | private $searchMappingService; |
||
57 | |||
58 | /** @var MiscService */ |
||
59 | private $miscService; |
||
60 | |||
61 | |||
62 | /** |
||
63 | * SearchService constructor. |
||
64 | * |
||
65 | * @param SearchMappingService $searchMappingService |
||
66 | * @param MiscService $miscService |
||
67 | */ |
||
68 | public function __construct( |
||
74 | |||
75 | /** |
||
76 | * @param Client $client |
||
77 | * @param ISearchResult $searchResult |
||
78 | * @param DocumentAccess $access |
||
79 | * |
||
80 | * @throws Exception |
||
81 | */ |
||
82 | public function searchRequest( |
||
110 | |||
111 | |||
112 | // /** |
||
113 | // * @param Client $client |
||
114 | // * @param IFullTextSearchProvider $provider |
||
115 | // * @param DocumentAccess $access |
||
116 | // * @param SearchResult $result |
||
117 | // * |
||
118 | // * @return SearchResult |
||
119 | // * @throws ConfigurationException |
||
120 | // */ |
||
121 | // public function fillSearchResult( |
||
122 | // Client $client, IFullTextSearchProvider $provider, DocumentAccess $access, |
||
123 | // SearchResult $searchResult |
||
124 | // ) { |
||
125 | // try { |
||
126 | // $query = $this->searchMappingService->generateSearchQuery( |
||
127 | // $provider, $access, $searchResult->getRequest() |
||
128 | // ); |
||
129 | // } catch (SearchQueryGenerationException $e) { |
||
130 | // return null; |
||
131 | // } |
||
132 | // |
||
133 | // try { |
||
134 | // $result = $client->search($query['params']); |
||
135 | // } catch (Exception $e) { |
||
136 | // $this->miscService->log( |
||
137 | // 'debug - request: ' . json_encode($searchResult->getRequest()) . ' - query: ' |
||
138 | // . json_encode($query) |
||
139 | // ); |
||
140 | // throw $e; |
||
141 | // } |
||
142 | // |
||
143 | // $this->updateSearchResult($searchResult, $result); |
||
144 | // |
||
145 | // foreach ($result['hits']['hits'] as $entry) { |
||
146 | // $searchResult->addDocument($this->parseSearchEntry($entry, $access->getViewerId())); |
||
147 | // } |
||
148 | // |
||
149 | // return $searchResult; |
||
150 | // } |
||
151 | |||
152 | |||
153 | /** |
||
154 | * @param Client $client |
||
155 | * @param string $providerId |
||
156 | * @param string $documentId |
||
157 | * |
||
158 | * @return IndexDocument |
||
159 | * @throws ConfigurationException |
||
160 | */ |
||
161 | public function getDocument(Client $client, string $providerId, string $documentId |
||
189 | |||
190 | |||
191 | /** |
||
192 | * @param ISearchResult $searchResult |
||
193 | * @param array $result |
||
194 | */ |
||
195 | private function updateSearchResult(ISearchResult $searchResult, array $result) { |
||
203 | |||
204 | |||
205 | /** |
||
206 | * @param array $entry |
||
207 | * @param string $viewerId |
||
208 | * |
||
209 | * @return IndexDocument |
||
210 | */ |
||
211 | private function parseSearchEntry(array $entry, string $viewerId): IndexDocument { |
||
231 | |||
232 | |||
233 | private function parseSearchEntryExcerpts(array $highlight): array { |
||
241 | |||
242 | } |
||
243 | |||
244 |
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: