@@ -31,9 +31,9 @@ |
||
| 31 | 31 | namespace OCA\FullTextSearch\AppInfo; |
| 32 | 32 | |
| 33 | 33 | |
| 34 | -$composerDir = __DIR__ . '/../vendor/'; |
|
| 34 | +$composerDir = __DIR__.'/../vendor/'; |
|
| 35 | 35 | |
| 36 | -if (is_dir($composerDir) && file_exists($composerDir . 'autoload.php')) { |
|
| 37 | - require_once $composerDir . 'autoload.php'; |
|
| 36 | +if (is_dir($composerDir) && file_exists($composerDir.'autoload.php')) { |
|
| 37 | + require_once $composerDir.'autoload.php'; |
|
| 38 | 38 | } |
| 39 | 39 | |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | use OCP\AppFramework\QueryException; |
| 35 | 35 | |
| 36 | 36 | |
| 37 | -require_once __DIR__ . '/autoload.php'; |
|
| 37 | +require_once __DIR__.'/autoload.php'; |
|
| 38 | 38 | |
| 39 | 39 | try { |
| 40 | 40 | $app = new Application(); |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $this->liveCycle(); |
| 101 | 101 | $this->runner->stop(); |
| 102 | 102 | } catch (Exception $e) { |
| 103 | - $this->miscService->log('Exception while cronIndex: ' . get_class($e) . ' - ' . $e->getMessage()); |
|
| 103 | + $this->miscService->log('Exception while cronIndex: '.get_class($e).' - '.$e->getMessage()); |
|
| 104 | 104 | $this->runner->exception($e->getMessage(), true); |
| 105 | 105 | } |
| 106 | 106 | |
@@ -164,6 +164,6 @@ discard block |
||
| 164 | 164 | * |
| 165 | 165 | */ |
| 166 | 166 | private function setLastErrReset() { |
| 167 | - $this->configService->setAppValue(ConfigService::CRON_LAST_ERR_RESET, (string) time()); |
|
| 167 | + $this->configService->setAppValue(ConfigService::CRON_LAST_ERR_RESET, (string)time()); |
|
| 168 | 168 | } |
| 169 | 169 | } |
@@ -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) { |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | |
| 79 | 79 | /** |
| 80 | - * @param IIndexOptions $options |
|
| 80 | + * @param \OCA\FullTextSearch\Model\IndexOptions $options |
|
| 81 | 81 | * |
| 82 | 82 | * @return IIndexDocument |
| 83 | 83 | */ |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | |
| 106 | 106 | /** |
| 107 | - * @param IIndexOptions $options |
|
| 107 | + * @param \OCA\FullTextSearch\Model\IndexOptions $options |
|
| 108 | 108 | * |
| 109 | 109 | * @return IIndexDocument |
| 110 | 110 | */ |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | public function generateIndexDocumentContentLicense(IIndexOptions $options): IIndexDocument { |
| 85 | 85 | $indexDocument = $this->generateIndexDocument(self::DOCUMENT_TYPE_LICENSE); |
| 86 | 86 | |
| 87 | - $content = file_get_contents(__DIR__ . '/../../LICENSE'); |
|
| 87 | + $content = file_get_contents(__DIR__.'/../../LICENSE'); |
|
| 88 | 88 | $indexDocument->setContent($content); |
| 89 | 89 | |
| 90 | 90 | if ($options === null) { |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | $orig = call_user_func([$origIndex, $method]); |
| 142 | 142 | $compare = call_user_func([$compareIndex, $method]); |
| 143 | 143 | if ($orig !== $compare) { |
| 144 | - throw new \Exception($method . '() orig:' . $orig . ' compare:' . $compare); |
|
| 144 | + throw new \Exception($method.'() orig:'.$orig.' compare:'.$compare); |
|
| 145 | 145 | |
| 146 | 146 | }; |
| 147 | 147 | } |
@@ -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 IIndexDocument[] $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 | |
@@ -126,12 +126,12 @@ |
||
| 126 | 126 | $output->writeln(substr($content, 0, 80)); |
| 127 | 127 | |
| 128 | 128 | $parts = $indexDocument->getParts(); |
| 129 | - $output->writeln(sizeof($parts) . ' Part(s)'); |
|
| 129 | + $output->writeln(sizeof($parts).' Part(s)'); |
|
| 130 | 130 | foreach (array_keys($parts) as $part) { |
| 131 | 131 | $output->writeln( |
| 132 | - "'" . $part . "' " . substr($parts[$part], 0, 80) . ' (size: ' . strlen( |
|
| 132 | + "'".$part."' ".substr($parts[$part], 0, 80).' (size: '.strlen( |
|
| 133 | 133 | $parts[$part] |
| 134 | - ) . ')' |
|
| 134 | + ).')' |
|
| 135 | 135 | ); |
| 136 | 136 | } |
| 137 | 137 | |
@@ -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 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | $provider = \OC::$server->query((string)$providerId); |
| 122 | 122 | if (!($provider instanceof IFullTextSearchProvider)) { |
| 123 | 123 | throw new ProviderIsNotCompatibleException( |
| 124 | - $providerId . ' is not a compatible IFullTextSearchProvider' |
|
| 124 | + $providerId.' is not a compatible IFullTextSearchProvider' |
|
| 125 | 125 | ); |
| 126 | 126 | } |
| 127 | 127 | |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | } |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | - throw new ProviderDoesNotExistException('Provider \'' . $providerId . '\' does not exist'); |
|
| 213 | + throw new ProviderDoesNotExistException('Provider \''.$providerId.'\' does not exist'); |
|
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | |
@@ -308,9 +308,9 @@ discard block |
||
| 308 | 308 | $this->loadProvider($appId, $provider); |
| 309 | 309 | } catch (Exception $e) { |
| 310 | 310 | $this->miscService->log( |
| 311 | - 'Issue while loading Provider: ' . $appId . '/' . $provider . ' - ' . get_class( |
|
| 311 | + 'Issue while loading Provider: '.$appId.'/'.$provider.' - '.get_class( |
|
| 312 | 312 | $e |
| 313 | - ) . ' ' . $e->getMessage() |
|
| 313 | + ).' '.$e->getMessage() |
|
| 314 | 314 | ); |
| 315 | 315 | } |
| 316 | 316 | } |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | $knownProvider = $providerWrapper->getProvider(); |
| 329 | 329 | if ($knownProvider->getId() === $provider->getId()) { |
| 330 | 330 | throw new ProviderIsNotUniqueException( |
| 331 | - 'FullTextSearchProvider ' . $provider->getId() . ' already exist' |
|
| 331 | + 'FullTextSearchProvider '.$provider->getId().' already exist' |
|
| 332 | 332 | ); |
| 333 | 333 | } |
| 334 | 334 | } |