@@ -26,9 +26,9 @@ |
||
| 26 | 26 | |
| 27 | 27 | namespace OCA\FullTextSearch_ElasticSearch\AppInfo; |
| 28 | 28 | |
| 29 | -$composerDir = __DIR__ . '/../vendor/'; |
|
| 29 | +$composerDir = __DIR__.'/../vendor/'; |
|
| 30 | 30 | |
| 31 | -if (is_dir($composerDir) && file_exists($composerDir . 'autoload.php')) { |
|
| 32 | - require_once $composerDir . 'autoload.php'; |
|
| 31 | +if (is_dir($composerDir) && file_exists($composerDir.'autoload.php')) { |
|
| 32 | + require_once $composerDir.'autoload.php'; |
|
| 33 | 33 | } |
| 34 | 34 | |
@@ -26,6 +26,6 @@ |
||
| 26 | 26 | |
| 27 | 27 | namespace OCA\FullTextSearch_ElasticSearch\AppInfo; |
| 28 | 28 | |
| 29 | -require_once __DIR__ . '/autoload.php'; |
|
| 29 | +require_once __DIR__.'/autoload.php'; |
|
| 30 | 30 | |
| 31 | 31 | new Application(); |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | 'index' => |
| 76 | 76 | [ |
| 77 | 77 | 'index' => $this->configService->getElasticIndex(), |
| 78 | - 'id' => $document->getProviderId() . ':' . $document->getId(), |
|
| 78 | + 'id' => $document->getProviderId().':'.$document->getId(), |
|
| 79 | 79 | 'type' => 'standard', |
| 80 | 80 | 'body' => $this->generateIndexBody($document) |
| 81 | 81 | ] |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | 'index' => |
| 106 | 106 | [ |
| 107 | 107 | 'index' => $this->configService->getElasticIndex(), |
| 108 | - 'id' => $document->getProviderId() . ':' . $document->getId(), |
|
| 108 | + 'id' => $document->getProviderId().':'.$document->getId(), |
|
| 109 | 109 | 'type' => 'standard', |
| 110 | 110 | 'body' => ['doc' => $this->generateIndexBody($document)] |
| 111 | 111 | ] |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | 'index' => |
| 134 | 134 | [ |
| 135 | 135 | 'index' => $this->configService->getElasticIndex(), |
| 136 | - 'id' => $providerId . ':' . $documentId, |
|
| 136 | + 'id' => $providerId.':'.$documentId, |
|
| 137 | 137 | 'type' => 'standard' |
| 138 | 138 | ] |
| 139 | 139 | ]; |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | /** |
| 109 | 109 | * @param Client $client |
| 110 | - * @param $providerId |
|
| 110 | + * @param string $providerId |
|
| 111 | 111 | * |
| 112 | 112 | * @throws ConfigurationException |
| 113 | 113 | */ |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | |
| 192 | 192 | /** |
| 193 | 193 | * @param Index $index |
| 194 | - * @param array $result |
|
| 194 | + * @param callable $result |
|
| 195 | 195 | * |
| 196 | 196 | * @return Index |
| 197 | 197 | */ |
@@ -344,8 +344,8 @@ |
||
| 344 | 344 | |
| 345 | 345 | |
| 346 | 346 | /** |
| 347 | - * @param $providerId |
|
| 348 | - * @param $documentId |
|
| 347 | + * @param string $providerId |
|
| 348 | + * @param string $documentId |
|
| 349 | 349 | * |
| 350 | 350 | * @return array |
| 351 | 351 | * @throws ConfigurationException |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | private function generateQueryContentFields(SearchRequest $request, QueryContent $content) { |
| 254 | 254 | $parts = array_map( |
| 255 | 255 | function($value) { |
| 256 | - return 'parts.' . $value; |
|
| 256 | + return 'parts.'.$value; |
|
| 257 | 257 | }, $request->getParts() |
| 258 | 258 | ); |
| 259 | 259 | $fields = array_merge(['content', 'title'], $request->getFields(), $parts); |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | |
| 268 | 268 | foreach ($request->getWildcardFields() as $field) { |
| 269 | 269 | if (!$this->fieldIsOutLimit($request, $field)) { |
| 270 | - $queryFields[] = ['wildcard' => [$field => '*' . $content->getWord() . '*']]; |
|
| 270 | + $queryFields[] = ['wildcard' => [$field => '*'.$content->getWord().'*']]; |
|
| 271 | 271 | } |
| 272 | 272 | } |
| 273 | 273 | |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | return [ |
| 355 | 355 | 'index' => $this->configService->getElasticIndex(), |
| 356 | 356 | 'type' => 'standard', |
| 357 | - 'id' => $providerId . ':' . $documentId |
|
| 357 | + 'id' => $providerId.':'.$documentId |
|
| 358 | 358 | ]; |
| 359 | 359 | } |
| 360 | 360 | |
@@ -104,12 +104,12 @@ |
||
| 104 | 104 | |
| 105 | 105 | foreach ($hosts as $host) { |
| 106 | 106 | $parsedHost = parse_url($host); |
| 107 | - $safeHost = $parsedHost['scheme'] . '://'; |
|
| 107 | + $safeHost = $parsedHost['scheme'].'://'; |
|
| 108 | 108 | if (array_key_exists('user', $parsedHost)) { |
| 109 | - $safeHost .= $parsedHost['user'] . ':' . '********' . '@'; |
|
| 109 | + $safeHost .= $parsedHost['user'].':'.'********'.'@'; |
|
| 110 | 110 | } |
| 111 | 111 | $safeHost .= $parsedHost['host']; |
| 112 | - $safeHost .= ':' . $parsedHost['port']; |
|
| 112 | + $safeHost .= ':'.$parsedHost['port']; |
|
| 113 | 113 | |
| 114 | 114 | $result[] = $safeHost; |
| 115 | 115 | } |
@@ -128,7 +128,7 @@ |
||
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /** |
| 131 | - * @param $action |
|
| 131 | + * @param string $action |
|
| 132 | 132 | * @param bool $force |
| 133 | 133 | * |
| 134 | 134 | * @throws Exception |
@@ -205,7 +205,7 @@ |
||
| 205 | 205 | |
| 206 | 206 | /** |
| 207 | 207 | * @param SearchResult $searchResult |
| 208 | - * @param array $result |
|
| 208 | + * @param callable $result |
|
| 209 | 209 | */ |
| 210 | 210 | private function updateSearchResult(SearchResult $searchResult, $result) { |
| 211 | 211 | $searchResult->setRawResult(json_encode($result)); |
@@ -116,7 +116,7 @@ |
||
| 116 | 116 | $result = $client->search($query['params']); |
| 117 | 117 | } catch (Exception $e) { |
| 118 | 118 | $this->miscService->log( |
| 119 | - 'debug - request: ' . json_encode($searchResult->getRequest()) . ' - query: ' |
|
| 119 | + 'debug - request: '.json_encode($searchResult->getRequest()).' - query: ' |
|
| 120 | 120 | . json_encode($query) |
| 121 | 121 | ); |
| 122 | 122 | throw $e; |