@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | } |
222 | 222 | ); |
223 | 223 | } catch (Throwable $t) { |
224 | - $this->miscService->log($t->getMessage() . ' -- ' . $t->getTraceAsString()); |
|
224 | + $this->miscService->log($t->getMessage().' -- '.$t->getTraceAsString()); |
|
225 | 225 | throw new Exception('Please install php-readline, or use --no-readline'); |
226 | 226 | } |
227 | 227 | } |
@@ -637,7 +637,7 @@ discard block |
||
637 | 637 | $index = $error['index']; |
638 | 638 | $errorIndex = ''; |
639 | 639 | if ($index !== null) { |
640 | - $errorIndex = $index->getProviderId() . ':' . $index->getDocumentId(); |
|
640 | + $errorIndex = $index->getProviderId().':'.$index->getDocumentId(); |
|
641 | 641 | } |
642 | 642 | |
643 | 643 | $width = $this->terminal->getWidth() - 13; |
@@ -689,7 +689,7 @@ discard block |
||
689 | 689 | $index = $result['index']; |
690 | 690 | $resultIndex = ''; |
691 | 691 | if ($index !== null) { |
692 | - $resultIndex = $index->getProviderId() . ':' . $index->getDocumentId(); |
|
692 | + $resultIndex = $index->getProviderId().':'.$index->getDocumentId(); |
|
693 | 693 | } |
694 | 694 | |
695 | 695 |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | |
269 | 269 | } catch (Exception $e) { |
270 | 270 | $this->miscService->log( |
271 | - 'Exception while live index: ' . get_class($e) . ' - ' . $e->getMessage() |
|
271 | + 'Exception while live index: '.get_class($e).' - '.$e->getMessage() |
|
272 | 272 | ); |
273 | 273 | |
274 | 274 | if (!$input->getOption('service')) { |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | $index = $result['index']; |
568 | 568 | $resultIndex = ''; |
569 | 569 | if ($index !== null) { |
570 | - $resultIndex = $index->getProviderId() . ':' . $index->getDocumentId(); |
|
570 | + $resultIndex = $index->getProviderId().':'.$index->getDocumentId(); |
|
571 | 571 | } |
572 | 572 | |
573 | 573 | |
@@ -625,7 +625,7 @@ discard block |
||
625 | 625 | $index = $error['index']; |
626 | 626 | $errorIndex = ''; |
627 | 627 | if ($index !== null) { |
628 | - $errorIndex = $index->getProviderId() . ':' . $index->getDocumentId(); |
|
628 | + $errorIndex = $index->getProviderId().':'.$index->getDocumentId(); |
|
629 | 629 | } |
630 | 630 | |
631 | 631 | $width = $this->terminal->getWidth() - 13; |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | } |
105 | 105 | |
106 | 106 | $output->writeln( |
107 | - 'Full text search ' . $this->configService->getAppValue('installed_version') |
|
107 | + 'Full text search '.$this->configService->getAppValue('installed_version') |
|
108 | 108 | ); |
109 | 109 | $output->writeln(' '); |
110 | 110 | |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | |
181 | 181 | $output->writeln('- Search Platform:'); |
182 | 182 | |
183 | - $output->writeln($platform->getName() . ' ' . $wrapper->getVersion()); |
|
183 | + $output->writeln($platform->getName().' '.$wrapper->getVersion()); |
|
184 | 184 | echo json_encode($platform->getConfiguration(), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); |
185 | 185 | |
186 | 186 | $output->writeln(' '); |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | |
207 | 207 | foreach ($providers as $providerWrapper) { |
208 | 208 | $provider = $providerWrapper->getProvider(); |
209 | - $output->writeln($provider->getName() . ' ' . $providerWrapper->getVersion()); |
|
209 | + $output->writeln($provider->getName().' '.$providerWrapper->getVersion()); |
|
210 | 210 | echo json_encode($provider->getConfiguration(), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); |
211 | 211 | $output->writeln(''); |
212 | 212 | } |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | * @return bool |
200 | 200 | */ |
201 | 201 | public function isAlreadyRunning(): bool { |
202 | - $ttl = (int) $this->configService->getAppValue(ConfigService::TICK_TTL); |
|
202 | + $ttl = (int)$this->configService->getAppValue(ConfigService::TICK_TTL); |
|
203 | 203 | $ticks = $this->tickRequest->getTicksByStatus('run'); |
204 | 204 | |
205 | 205 | $isAlreadyRunning = false; |
@@ -238,18 +238,18 @@ discard block |
||
238 | 238 | $preAction = $tick->getAction(); |
239 | 239 | |
240 | 240 | if ($preAction !== '') { |
241 | - $preActionTotal = $tick->getInfoFloat($preAction . 'Total', 0); |
|
242 | - $preActionStart = $tick->getInfoFloat($preAction . 'Init', 0); |
|
241 | + $preActionTotal = $tick->getInfoFloat($preAction.'Total', 0); |
|
242 | + $preActionStart = $tick->getInfoFloat($preAction.'Init', 0); |
|
243 | 243 | |
244 | 244 | if ($preActionStart > 0) { |
245 | 245 | |
246 | 246 | $preActionTotal += ($now - $preActionStart); |
247 | - $tick->setInfoFloat($preAction . 'Total', $preActionTotal); |
|
248 | - $tick->unsetInfo($preAction . 'Init'); |
|
247 | + $tick->setInfoFloat($preAction.'Total', $preActionTotal); |
|
248 | + $tick->unsetInfo($preAction.'Init'); |
|
249 | 249 | } |
250 | 250 | } |
251 | 251 | $tick->setAction($action) |
252 | - ->setInfoFloat($action . 'Init', $now); |
|
252 | + ->setInfoFloat($action.'Init', $now); |
|
253 | 253 | } |
254 | 254 | |
255 | 255 |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | } |
251 | 251 | |
252 | 252 | if ($color !== '') { |
253 | - $this->info[$info . 'Colored'] = '<' . $color . '>' . $value . '</' . $color . '>'; |
|
253 | + $this->info[$info.'Colored'] = '<'.$color.'>'.$value.'</'.$color.'>'; |
|
254 | 254 | } |
255 | 255 | } |
256 | 256 | |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | return; |
394 | 394 | } |
395 | 395 | |
396 | - $this->setInfo('_memory', round((memory_get_usage() / 1024 / 1024)) . ' MB'); |
|
396 | + $this->setInfo('_memory', round((memory_get_usage() / 1024 / 1024)).' MB'); |
|
397 | 397 | $this->ramUpdate = $tick; |
398 | 398 | } |
399 | 399 | |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | */ |
407 | 407 | public function exception(string $reason, bool $stop) { |
408 | 408 | if (!$stop) { |
409 | - $this->output('Exception: ' . $reason); |
|
409 | + $this->output('Exception: '.$reason); |
|
410 | 410 | // TODO: feed an array of exceptions for log; |
411 | 411 | } else { |
412 | 412 | try { |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $provider = OC::$server->query((string)$providerId); |
123 | 123 | if (!($provider instanceof IFullTextSearchProvider)) { |
124 | 124 | throw new ProviderIsNotCompatibleException( |
125 | - $providerId . ' is not a compatible IFullTextSearchProvider' |
|
125 | + $providerId.' is not a compatible IFullTextSearchProvider' |
|
126 | 126 | ); |
127 | 127 | } |
128 | 128 | |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | } |
212 | 212 | } |
213 | 213 | |
214 | - throw new ProviderDoesNotExistException('Provider \'' . $providerId . '\' does not exist'); |
|
214 | + throw new ProviderDoesNotExistException('Provider \''.$providerId.'\' does not exist'); |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | |
@@ -305,9 +305,9 @@ discard block |
||
305 | 305 | $this->loadProvider($appId, $provider); |
306 | 306 | } catch (Exception $e) { |
307 | 307 | $this->miscService->log( |
308 | - 'Issue while loading Provider: ' . $appId . '/' . $provider . ' - ' . get_class( |
|
308 | + 'Issue while loading Provider: '.$appId.'/'.$provider.' - '.get_class( |
|
309 | 309 | $e |
310 | - ) . ' ' . $e->getMessage() |
|
310 | + ).' '.$e->getMessage() |
|
311 | 311 | ); |
312 | 312 | } |
313 | 313 | } |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | $knownProvider = $providerWrapper->getProvider(); |
326 | 326 | if ($knownProvider->getId() === $provider->getId()) { |
327 | 327 | throw new ProviderIsNotUniqueException( |
328 | - 'FullTextSearchProvider ' . $provider->getId() . ' already exist' |
|
328 | + 'FullTextSearchProvider '.$provider->getId().' already exist' |
|
329 | 329 | ); |
330 | 330 | } |
331 | 331 | } |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | $platform = OC::$server->query((string)$selected->getClass()); |
174 | 174 | if (!($platform instanceof IFullTextSearchPlatform)) { |
175 | 175 | throw new PlatformIsNotCompatibleException( |
176 | - $selected->getClass() . ' is not a compatible FullTextSearchPlatform' |
|
176 | + $selected->getClass().' is not a compatible FullTextSearchPlatform' |
|
177 | 177 | ); |
178 | 178 | } |
179 | 179 | |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | } |
206 | 206 | |
207 | 207 | throw new PlatformDoesNotExistException( |
208 | - 'FullTextSearchPlatform ' . $selected . ' is not available' |
|
208 | + 'FullTextSearchPlatform '.$selected.' is not available' |
|
209 | 209 | ); |
210 | 210 | } |
211 | 211 |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | $this->runner->stop(); |
104 | 104 | } catch (RunnerAlreadyUpException $e) { |
105 | 105 | } catch (Exception $e) { |
106 | - $this->miscService->log('Exception while cronIndex: ' . get_class($e) . ' - ' . $e->getMessage()); |
|
106 | + $this->miscService->log('Exception while cronIndex: '.get_class($e).' - '.$e->getMessage()); |
|
107 | 107 | $this->runner->exception($e->getMessage(), true); |
108 | 108 | } |
109 | 109 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | |
134 | 134 | $this->indexService->updateDocument($platform, $provider, $index); |
135 | 135 | } catch (Throwable | Exception $e) { |
136 | - $this->runner->exception(get_class($e) . ' - ' . $e->getMessage(), false); |
|
136 | + $this->runner->exception(get_class($e).' - '.$e->getMessage(), false); |
|
137 | 137 | // TODO - upgrade error number - after too many errors, delete index |
138 | 138 | // TODO - do not count error if elasticsearch is down. |
139 | 139 | } |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $output->write(' ', true); |
217 | 217 | } |
218 | 218 | |
219 | - $output->write($line . ' ', false); |
|
219 | + $output->write($line.' ', false); |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | $testProvider->setIndexOptions(new IndexOptions()); |
278 | 278 | $indexableDocuments = |
279 | 279 | $testProvider->generateIndexableDocuments(TestService::DOCUMENT_USER1, ''); |
280 | - $this->output($output, '(' . sizeof($indexableDocuments) . ' items)', false); |
|
280 | + $this->output($output, '('.sizeof($indexableDocuments).' items)', false); |
|
281 | 281 | $this->outputResult($output, true); |
282 | 282 | } |
283 | 283 | |
@@ -293,12 +293,12 @@ discard block |
||
293 | 293 | $wrapper = $this->platformService->getPlatform(); |
294 | 294 | $testPlatform = $wrapper->getPlatform(); |
295 | 295 | |
296 | - $this->output($output, '(' . $testPlatform->getName() . ')', false); |
|
296 | + $this->output($output, '('.$testPlatform->getName().')', false); |
|
297 | 297 | $this->outputResult($output, true); |
298 | 298 | |
299 | 299 | $this->output($output, 'Testing search platform.'); |
300 | 300 | if (!$testPlatform->testPlatform()) { |
301 | - throw new Exception ('Search platform (' . $testPlatform->getName() . ') down ?'); |
|
301 | + throw new Exception('Search platform ('.$testPlatform->getName().') down ?'); |
|
302 | 302 | } |
303 | 303 | $this->outputResult($output, true); |
304 | 304 | |
@@ -395,13 +395,13 @@ discard block |
||
395 | 395 | ); |
396 | 396 | |
397 | 397 | $this->output( |
398 | - $output, '(size: ' . $indexDocument->getContentSize() . ')', false |
|
398 | + $output, '(size: '.$indexDocument->getContentSize().')', false |
|
399 | 399 | ); |
400 | 400 | $this->outputResult($output, true); |
401 | 401 | } catch (Exception $e) { |
402 | 402 | throw new Exception( |
403 | - "Issue while getting test document '" . TestService::DOCUMENT_TYPE_LICENSE |
|
404 | - . "' from search platform: " . $e->getMessage() |
|
403 | + "Issue while getting test document '".TestService::DOCUMENT_TYPE_LICENSE |
|
404 | + . "' from search platform: ".$e->getMessage() |
|
405 | 405 | ); |
406 | 406 | } |
407 | 407 | |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | ) { |
572 | 572 | $this->output( |
573 | 573 | $output, |
574 | - " - '" . $search . "'" . (($moreOutput === '') ? '' : ' - ' . $moreOutput . ' - ') |
|
574 | + " - '".$search."'".(($moreOutput === '') ? '' : ' - '.$moreOutput.' - ') |
|
575 | 575 | ); |
576 | 576 | $request = new SearchRequest(); |
577 | 577 | |
@@ -585,7 +585,7 @@ discard block |
||
585 | 585 | |
586 | 586 | $this->output( |
587 | 587 | $output, |
588 | - '(result: ' . $searchResult->getCount() . ', expected: ' . json_encode($expected) . ')', |
|
588 | + '(result: '.$searchResult->getCount().', expected: '.json_encode($expected).')', |
|
589 | 589 | false |
590 | 590 | ); |
591 | 591 | $this->compareSearchResult($searchResult, $expected); |
@@ -649,12 +649,12 @@ discard block |
||
649 | 649 | private function compareSearchResult(SearchResult $searchResult, array $entries) { |
650 | 650 | $documents = $searchResult->getDocuments(); |
651 | 651 | if (sizeof($documents) !== sizeof($entries)) { |
652 | - throw new Exception('Unexpected SearchResult: ' . json_encode($searchResult)); |
|
652 | + throw new Exception('Unexpected SearchResult: '.json_encode($searchResult)); |
|
653 | 653 | } |
654 | 654 | |
655 | 655 | foreach ($documents as $document) { |
656 | 656 | if (!in_array($document->getId(), $entries)) { |
657 | - throw new Exception('Unexpected Document: ' . json_encode($document)); |
|
657 | + throw new Exception('Unexpected Document: '.json_encode($document)); |
|
658 | 658 | } |
659 | 659 | } |
660 | 660 | } |
@@ -667,7 +667,7 @@ discard block |
||
667 | 667 | * @throws InterruptException |
668 | 668 | */ |
669 | 669 | private function pause(OutputInterface $output, int $s) { |
670 | - $this->output($output, 'Pausing ' . $s . ' seconds'); |
|
670 | + $this->output($output, 'Pausing '.$s.' seconds'); |
|
671 | 671 | |
672 | 672 | for ($i = 1; $i <= $s; $i++) { |
673 | 673 | if (time_nanosleep(1, 0) !== true) { |