@@ -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 | } |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | $this->runner->stop(); |
| 103 | 103 | } catch (RunnerAlreadyUpException $e) { |
| 104 | 104 | } catch (Exception $e) { |
| 105 | - $this->miscService->log('Exception while cronIndex: ' . get_class($e) . ' - ' . $e->getMessage()); |
|
| 105 | + $this->miscService->log('Exception while cronIndex: '.get_class($e).' - '.$e->getMessage()); |
|
| 106 | 106 | $this->runner->exception($e->getMessage(), true); |
| 107 | 107 | } |
| 108 | 108 | |
@@ -166,6 +166,6 @@ discard block |
||
| 166 | 166 | * |
| 167 | 167 | */ |
| 168 | 168 | private function setLastErrReset() { |
| 169 | - $this->configService->setAppValue(ConfigService::CRON_LAST_ERR_RESET, (string) time()); |
|
| 169 | + $this->configService->setAppValue(ConfigService::CRON_LAST_ERR_RESET, (string)time()); |
|
| 170 | 170 | } |
| 171 | 171 | } |
@@ -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 | |