@@ -631,7 +631,7 @@ |
||
631 | 631 | } |
632 | 632 | |
633 | 633 | /** |
634 | - * @param array $filters |
|
634 | + * @param string[] $filters |
|
635 | 635 | * |
636 | 636 | * @return ISearchRequest |
637 | 637 | */ |
@@ -85,7 +85,7 @@ |
||
85 | 85 | |
86 | 86 | /** |
87 | 87 | * @param string $panelId |
88 | - * @param array $lines |
|
88 | + * @param string[] $lines |
|
89 | 89 | */ |
90 | 90 | public function createPanel(string $panelId, array $lines) { |
91 | 91 | if (!is_array($lines)) { |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | /** |
197 | 197 | * @param IFullTextSearchProvider $provider |
198 | 198 | * @param IndexDocument[] $documents |
199 | - * @param IIndexOptions $options |
|
199 | + * @param IndexOptions $options |
|
200 | 200 | * |
201 | 201 | * @return IndexDocument[] |
202 | 202 | * @throws Exception |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | |
478 | 478 | |
479 | 479 | /** |
480 | - * @param IIndex $index |
|
480 | + * @param Index $index |
|
481 | 481 | */ |
482 | 482 | private function updateIndexError(IIndex $index) { |
483 | 483 |
@@ -165,7 +165,7 @@ |
||
165 | 165 | IFullTextSearchPlatform $platform, IFullTextSearchProvider $provider, string $userId, |
166 | 166 | IndexOptions $options |
167 | 167 | ) { |
168 | - $this->updateRunnerAction('generateIndex' . $provider->getName()); |
|
168 | + $this->updateRunnerAction('generateIndex'.$provider->getName()); |
|
169 | 169 | $this->updateRunnerInfoArray( |
170 | 170 | [ |
171 | 171 | 'userId' => $userId, |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | |
77 | 77 | |
78 | 78 | /** |
79 | - * @param IIndexOptions $options |
|
79 | + * @param \OCA\FullTextSearch\Model\IndexOptions $options |
|
80 | 80 | * |
81 | 81 | * @return IndexDocument |
82 | 82 | */ |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | |
104 | 104 | |
105 | 105 | /** |
106 | - * @param IIndexOptions $options |
|
106 | + * @param \OCA\FullTextSearch\Model\IndexOptions $options |
|
107 | 107 | * |
108 | 108 | * @return IndexDocument |
109 | 109 | */ |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | public function generateIndexDocumentContentLicense(IIndexOptions $options): IndexDocument { |
84 | 84 | $indexDocument = $this->generateIndexDocument(self::DOCUMENT_TYPE_LICENSE); |
85 | 85 | |
86 | - $content = file_get_contents(__DIR__ . '/../../LICENSE'); |
|
86 | + $content = file_get_contents(__DIR__.'/../../LICENSE'); |
|
87 | 87 | $indexDocument->setContent($content); |
88 | 88 | |
89 | 89 | if ($options === null) { |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $orig = call_user_func([$origIndex, $method]); |
141 | 141 | $compare = call_user_func([$compareIndex, $method]); |
142 | 142 | if ($orig !== $compare) { |
143 | - throw new \Exception($method . '() orig:' . $orig . ' compare:' . $compare); |
|
143 | + throw new \Exception($method.'() orig:'.$orig.' compare:'.$compare); |
|
144 | 144 | |
145 | 145 | }; |
146 | 146 | } |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | $output->write(' ', true); |
216 | 216 | } |
217 | 217 | |
218 | - $output->write($line . ' ', false); |
|
218 | + $output->write($line.' ', false); |
|
219 | 219 | } |
220 | 220 | |
221 | 221 | |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | $testProvider->setIndexOptions(new IndexOptions()); |
277 | 277 | $indexableDocuments = |
278 | 278 | $testProvider->generateIndexableDocuments(TestService::DOCUMENT_USER1); |
279 | - $this->output($output, '(' . sizeof($indexableDocuments) . ' items)', false); |
|
279 | + $this->output($output, '('.sizeof($indexableDocuments).' items)', false); |
|
280 | 280 | $this->outputResult($output, true); |
281 | 281 | } |
282 | 282 | |
@@ -292,12 +292,12 @@ discard block |
||
292 | 292 | $wrapper = $this->platformService->getPlatform(); |
293 | 293 | $testPlatform = $wrapper->getPlatform(); |
294 | 294 | |
295 | - $this->output($output, '(' . $testPlatform->getName() . ')', false); |
|
295 | + $this->output($output, '('.$testPlatform->getName().')', false); |
|
296 | 296 | $this->outputResult($output, true); |
297 | 297 | |
298 | 298 | $this->output($output, 'Testing search platform.'); |
299 | 299 | if (!$testPlatform->testPlatform()) { |
300 | - throw new Exception ('Search platform (' . $testPlatform->getName() . ') down ?'); |
|
300 | + throw new Exception('Search platform ('.$testPlatform->getName().') down ?'); |
|
301 | 301 | } |
302 | 302 | $this->outputResult($output, true); |
303 | 303 | |
@@ -393,13 +393,13 @@ discard block |
||
393 | 393 | ); |
394 | 394 | |
395 | 395 | $this->output( |
396 | - $output, '(size: ' . $indexDocument->getContentSize() . ')', false |
|
396 | + $output, '(size: '.$indexDocument->getContentSize().')', false |
|
397 | 397 | ); |
398 | 398 | $this->outputResult($output, true); |
399 | 399 | } catch (Exception $e) { |
400 | 400 | throw new Exception( |
401 | - "Issue while getting test document '" . TestService::DOCUMENT_TYPE_LICENSE |
|
402 | - . "' from search platform: " . $e->getMessage() |
|
401 | + "Issue while getting test document '".TestService::DOCUMENT_TYPE_LICENSE |
|
402 | + . "' from search platform: ".$e->getMessage() |
|
403 | 403 | ); |
404 | 404 | } |
405 | 405 | |
@@ -569,7 +569,7 @@ discard block |
||
569 | 569 | ) { |
570 | 570 | $this->output( |
571 | 571 | $output, |
572 | - " - '" . $search . "'" . (($moreOutput === '') ? '' : ' - ' . $moreOutput . ' - ') |
|
572 | + " - '".$search."'".(($moreOutput === '') ? '' : ' - '.$moreOutput.' - ') |
|
573 | 573 | ); |
574 | 574 | $request = new SearchRequest(); |
575 | 575 | |
@@ -583,7 +583,7 @@ discard block |
||
583 | 583 | |
584 | 584 | $this->output( |
585 | 585 | $output, |
586 | - '(result: ' . $searchResult->getCount() . ', expected: ' . json_encode($expected) . ')', |
|
586 | + '(result: '.$searchResult->getCount().', expected: '.json_encode($expected).')', |
|
587 | 587 | false |
588 | 588 | ); |
589 | 589 | $this->compareSearchResult($searchResult, $expected); |
@@ -647,12 +647,12 @@ discard block |
||
647 | 647 | private function compareSearchResult(SearchResult $searchResult, array $entries) { |
648 | 648 | $documents = $searchResult->getDocuments(); |
649 | 649 | if (sizeof($documents) !== sizeof($entries)) { |
650 | - throw new \Exception('Unexpected SearchResult: ' . json_encode($searchResult)); |
|
650 | + throw new \Exception('Unexpected SearchResult: '.json_encode($searchResult)); |
|
651 | 651 | } |
652 | 652 | |
653 | 653 | foreach ($documents as $document) { |
654 | 654 | if (!in_array($document->getId(), $entries)) { |
655 | - throw new \Exception('Unexpected Document: ' . json_encode($document)); |
|
655 | + throw new \Exception('Unexpected Document: '.json_encode($document)); |
|
656 | 656 | } |
657 | 657 | } |
658 | 658 | } |
@@ -665,7 +665,7 @@ discard block |
||
665 | 665 | * @throws InterruptException |
666 | 666 | */ |
667 | 667 | private function pause(OutputInterface $output, int $s) { |
668 | - $this->output($output, 'Pausing ' . $s . ' seconds'); |
|
668 | + $this->output($output, 'Pausing '.$s.' seconds'); |
|
669 | 669 | |
670 | 670 | for ($i = 1; $i <= $s; $i++) { |
671 | 671 | if (time_nanosleep(1, 0) !== true) { |
@@ -123,13 +123,13 @@ |
||
123 | 123 | */ |
124 | 124 | private function displaySearchResult(ISearchResult $searchResult) { |
125 | 125 | /** @var SearchResult $searchResult */ |
126 | - echo '> ' . $searchResult->getProvider() |
|
127 | - ->getName() . "\n"; |
|
126 | + echo '> '.$searchResult->getProvider() |
|
127 | + ->getName()."\n"; |
|
128 | 128 | |
129 | 129 | /** @var IndexDocument[] $result */ |
130 | 130 | $result = $searchResult->getDocuments(); |
131 | 131 | foreach ($result as $document) { |
132 | - echo ' - ' . $document->getId() . ' score:' . $document->getScore() . "\n"; |
|
132 | + echo ' - '.$document->getId().' score:'.$document->getScore()."\n"; |
|
133 | 133 | } |
134 | 134 | } |
135 | 135 |
@@ -108,10 +108,10 @@ |
||
108 | 108 | * @return Tick |
109 | 109 | */ |
110 | 110 | protected function parseTickSelectSql(array $data): Tick { |
111 | - $tick = new Tick($data['source'], (int) $data['id']); |
|
111 | + $tick = new Tick($data['source'], (int)$data['id']); |
|
112 | 112 | $tick->setData(json_decode($data['data'], true)) |
113 | - ->setTick((int) $data['tick']) |
|
114 | - ->setFirstTick((int) $data['first_tick']) |
|
113 | + ->setTick((int)$data['tick']) |
|
114 | + ->setFirstTick((int)$data['first_tick']) |
|
115 | 115 | ->setStatus($data['status']) |
116 | 116 | ->setAction($data['action']); |
117 | 117 |
@@ -191,8 +191,8 @@ discard block |
||
191 | 191 | */ |
192 | 192 | private function limitToDBField(IQueryBuilder &$qb, string $field, string $value) { |
193 | 193 | $expr = $qb->expr(); |
194 | - $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->defaultSelectAlias . '.' : ''; |
|
195 | - $field = $pf . $field; |
|
194 | + $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->defaultSelectAlias.'.' : ''; |
|
195 | + $field = $pf.$field; |
|
196 | 196 | |
197 | 197 | $qb->andWhere($expr->eq($field, $qb->createNamedParameter($value))); |
198 | 198 | } |
@@ -204,8 +204,8 @@ discard block |
||
204 | 204 | */ |
205 | 205 | private function limitToDBFieldInt(IQueryBuilder &$qb, string $field, int $value) { |
206 | 206 | $expr = $qb->expr(); |
207 | - $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->defaultSelectAlias . '.' : ''; |
|
208 | - $field = $pf . $field; |
|
207 | + $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->defaultSelectAlias.'.' : ''; |
|
208 | + $field = $pf.$field; |
|
209 | 209 | |
210 | 210 | $qb->andWhere($expr->eq($field, $qb->createNamedParameter($value))); |
211 | 211 | } |
@@ -218,8 +218,8 @@ discard block |
||
218 | 218 | */ |
219 | 219 | private function limitToDBFieldArray(IQueryBuilder &$qb, string $field, array $values) { |
220 | 220 | $expr = $qb->expr(); |
221 | - $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->defaultSelectAlias . '.' : ''; |
|
222 | - $field = $pf . $field; |
|
221 | + $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->defaultSelectAlias.'.' : ''; |
|
222 | + $field = $pf.$field; |
|
223 | 223 | |
224 | 224 | if (!is_array($values)) { |
225 | 225 | $values = [$values]; |
@@ -239,8 +239,8 @@ discard block |
||
239 | 239 | */ |
240 | 240 | protected function limitToQueuedIndexes(IQueryBuilder &$qb) { |
241 | 241 | $expr = $qb->expr(); |
242 | - $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->defaultSelectAlias . '.' : ''; |
|
243 | - $qb->andWhere($expr->neq($pf . 'status', $qb->createNamedParameter(Index::INDEX_OK))); |
|
242 | + $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->defaultSelectAlias.'.' : ''; |
|
243 | + $qb->andWhere($expr->neq($pf.'status', $qb->createNamedParameter(Index::INDEX_OK))); |
|
244 | 244 | } |
245 | 245 | |
246 | 246 | } |
@@ -163,6 +163,6 @@ |
||
163 | 163 | * |
164 | 164 | */ |
165 | 165 | private function setLastErrReset() { |
166 | - $this->configService->setAppValue(ConfigService::CRON_LAST_ERR_RESET, (string) time()); |
|
166 | + $this->configService->setAppValue(ConfigService::CRON_LAST_ERR_RESET, (string)time()); |
|
167 | 167 | } |
168 | 168 | } |