Conditions | 3 |
Paths | 2 |
Total Lines | 20 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
53 | public function deleteDocumentsOfType() |
||
54 | { |
||
55 | $this->logger->info('Removing all documents of type ' . $this->typeName); |
||
56 | $languages = ApplicationConfiguration::getLanguageConfiguration(); |
||
57 | if (count($languages) > 0) { |
||
58 | foreach ($languages as $language) { |
||
59 | $index = $this->client->getIndex($this->indexName . '_' . $language); |
||
60 | $this->logger->info('Removing documents of type ' . $this->typeName . ' from index ' . $index); |
||
61 | $index->getType($this->typeName)->deleteByQuery( |
||
62 | new Query\MatchAll() |
||
|
|||
63 | ); |
||
64 | $index->refresh(); |
||
65 | } |
||
66 | |||
67 | } else { |
||
68 | $this->client->getIndex($this->indexName)->getType($this->typeName)->deleteByQuery(new Query\MatchAll()); |
||
69 | $this->client->getIndex($this->indexName)->refresh(); |
||
70 | } |
||
71 | $this->logger->info('Removed all documents of type ' . $this->typeName); |
||
72 | } |
||
73 | } |
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: