@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |
100 | - * @param $action |
|
100 | + * @param string $action |
|
101 | 101 | * |
102 | 102 | * @throws InterruptException |
103 | 103 | * @throws TickDoesNotExistException |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | |
113 | 113 | |
114 | 114 | /** |
115 | - * @param $line |
|
115 | + * @param string $line |
|
116 | 116 | */ |
117 | 117 | private function outputRunner($line) { |
118 | 118 | if ($this->runner === null) { |
@@ -102,12 +102,12 @@ discard block |
||
102 | 102 | public function getConfiguration() { |
103 | 103 | |
104 | 104 | $parsedHost = parse_url($this->configService->getElasticHost()); |
105 | - $safeHost = $parsedHost['scheme'] . '://'; |
|
105 | + $safeHost = $parsedHost['scheme'].'://'; |
|
106 | 106 | if (array_key_exists('user', $parsedHost)) { |
107 | - $safeHost .= $parsedHost['user'] . ':' . '********' . '@'; |
|
107 | + $safeHost .= $parsedHost['user'].':'.'********'.'@'; |
|
108 | 108 | } |
109 | 109 | $safeHost .= $parsedHost['host']; |
110 | - $safeHost .= ':' . $parsedHost['port']; |
|
110 | + $safeHost .= ':'.$parsedHost['port']; |
|
111 | 111 | |
112 | 112 | return [ |
113 | 113 | 'elastic_host' => $safeHost, |
@@ -238,11 +238,11 @@ discard block |
||
238 | 238 | public function indexDocument(IFullTextSearchProvider $provider, IndexDocument $document) { |
239 | 239 | |
240 | 240 | $this->updateRunner('indexDocument'); |
241 | - $this->outputRunner(' . Indexing: ' . $document->getTitle()); |
|
241 | + $this->outputRunner(' . Indexing: '.$document->getTitle()); |
|
242 | 242 | |
243 | 243 | try { |
244 | 244 | $result = $this->indexService->indexDocument($this->client, $provider, $document); |
245 | - $this->outputRunner(' result: ' . json_encode($result)); |
|
245 | + $this->outputRunner(' result: '.json_encode($result)); |
|
246 | 246 | |
247 | 247 | return $this->indexService->parseIndexResult($document->getIndex(), $result); |
248 | 248 | } catch (Exception $e) { |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | $index->setMessage(json_encode($message)); |
276 | 276 | |
277 | 277 | $result = $this->indexService->indexDocument($this->client, $provider, $document); |
278 | - $this->outputRunner(' result with no content: ' . json_encode($result)); |
|
278 | + $this->outputRunner(' result with no content: '.json_encode($result)); |
|
279 | 279 | |
280 | 280 | return $this->indexService->parseIndexResult($document->getIndex(), $result); |
281 | 281 | } |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | echo "Max retries!"; |
331 | 331 | } |
332 | 332 | } catch (Exception $e) { |
333 | - echo ' ElasticSearchPlatform::load() Exception --- ' . $e->getMessage() . "\n"; |
|
333 | + echo ' ElasticSearchPlatform::load() Exception --- '.$e->getMessage()."\n"; |
|
334 | 334 | } |
335 | 335 | } |
336 | 336 |
@@ -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 | ]; |
@@ -157,7 +157,7 @@ |
||
157 | 157 | |
158 | 158 | /** |
159 | 159 | * @param Index $index |
160 | - * @param array $result |
|
160 | + * @param callable $result |
|
161 | 161 | * |
162 | 162 | * @return Index |
163 | 163 | */ |
@@ -87,7 +87,7 @@ |
||
87 | 87 | |
88 | 88 | |
89 | 89 | /** |
90 | - * @param array $result |
|
90 | + * @param callable $result |
|
91 | 91 | * |
92 | 92 | * @return SearchResult |
93 | 93 | */ |
@@ -84,7 +84,7 @@ |
||
84 | 84 | $result = $client->search($query['params']); |
85 | 85 | } catch (Exception $e) { |
86 | 86 | $this->miscService->log( |
87 | - 'debug - request: ' . json_encode($request) . ' - query: ' . json_encode($query) |
|
87 | + 'debug - request: '.json_encode($request).' - query: '.json_encode($query) |
|
88 | 88 | ); |
89 | 89 | throw $e; |
90 | 90 | } |
@@ -232,7 +232,7 @@ |
||
232 | 232 | |
233 | 233 | $parts = array_map( |
234 | 234 | function($value) { |
235 | - return 'parts.' . $value; |
|
235 | + return 'parts.'.$value; |
|
236 | 236 | }, $request->getParts() |
237 | 237 | ); |
238 | 238 | $fields = array_merge(['content', 'title'], $request->getFields(), $parts); |