Completed
Pull Request — master (#246)
by Maxence
17s
created
lib/Service/SearchMappingService.php 1 patch
Spacing   +5 added lines, -6 removed lines patch added patch discarded remove patch
@@ -48,8 +48,7 @@  discard block
 block discarded – undo
48 48
  */
49 49
 class SearchMappingService {
50 50
 
51
-	public function __construct
52
-	(
51
+	public function __construct(
53 52
 		private ConfigService $configService
54 53
 	) {
55 54
 	}
@@ -275,7 +274,7 @@  discard block
 block discarded – undo
275 274
 
276 275
 		foreach ($request->getWildcardFields() as $field) {
277 276
 			if (!$this->fieldIsOutLimit($request, $field)) {
278
-				$queryFields[] = ['wildcard' => [$field => '*' . $content->getWord() . '*']];
277
+				$queryFields[] = ['wildcard' => [$field => '*'.$content->getWord().'*']];
279 278
 			}
280 279
 		}
281 280
 
@@ -439,7 +438,7 @@  discard block
 block discarded – undo
439 438
 	public function getDocumentQuery(string $providerId, string $documentId): array {
440 439
 		return [
441 440
 			'index' => $this->configService->getElasticIndex(),
442
-			'id' => $providerId . ':' . $documentId
441
+			'id' => $providerId.':'.$documentId
443 442
 		];
444 443
 	}
445 444
 
@@ -451,8 +450,8 @@  discard block
 block discarded – undo
451 450
 	 */
452 451
 	private function getPartsFields(ISearchRequest $request): array {
453 452
 		return array_map(
454
-			function ($value) {
455
-				return 'parts.' . $value;
453
+			function($value) {
454
+				return 'parts.'.$value;
456 455
 			}, $request->getParts()
457 456
 		);
458 457
 	}
Please login to merge, or discard this patch.
lib/Service/IndexMappingService.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 			'index' =>
68 68
 				[
69 69
 					'index' => $this->configService->getElasticIndex(),
70
-					'id' => $document->getProviderId() . ':' . $document->getId(),
70
+					'id' => $document->getProviderId().':'.$document->getId(),
71 71
 					'body' => $this->generateIndexBody($document)
72 72
 				]
73 73
 		];
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 			'index' =>
96 96
 				[
97 97
 					'index' => $this->configService->getElasticIndex(),
98
-					'id' => $document->getProviderId() . ':' . $document->getId(),
98
+					'id' => $document->getProviderId().':'.$document->getId(),
99 99
 					'body' => ['doc' => $this->generateIndexBody($document)]
100 100
 				]
101 101
 		];
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 			'index' =>
126 126
 				[
127 127
 					'index' => $this->configService->getElasticIndex(),
128
-					'id' => $providerId . ':' . $documentId,
128
+					'id' => $providerId.':'.$documentId,
129 129
 				]
130 130
 		];
131 131
 
Please login to merge, or discard this patch.
lib/Service/SearchService.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	): void {
76 76
 		try {
77 77
 			$this->logger->log(
78
-				0, 'New Search Request; SearchResult Model: ' . json_encode($searchResult)
78
+				0, 'New Search Request; SearchResult Model: '.json_encode($searchResult)
79 79
 			);
80 80
 			$query = $this->searchMappingService->generateSearchQuery(
81 81
 				$searchResult->getRequest(), $access, $searchResult->getProvider()
@@ -86,24 +86,24 @@  discard block
 block discarded – undo
86 86
 		}
87 87
 
88 88
 		try {
89
-			$this->logger->log(0, 'Searching ES: ' . json_encode($query['params']));
89
+			$this->logger->log(0, 'Searching ES: '.json_encode($query['params']));
90 90
 
91 91
 			$result = $client->search($query['params']);
92 92
 		} catch (Exception $e) {
93 93
 			$this->logger->log(
94
-				0, 'request: ' . json_encode($searchResult->getRequest()) . ' - query: ' . json_encode($query)
94
+				0, 'request: '.json_encode($searchResult->getRequest()).' - query: '.json_encode($query)
95 95
 			);
96 96
 			throw $e;
97 97
 		}
98 98
 
99
-		$this->logger->log(0, 'Result from ES: ' . json_encode($result));
99
+		$this->logger->log(0, 'Result from ES: '.json_encode($result));
100 100
 		$this->updateSearchResult($searchResult, $result->asArray());
101 101
 
102 102
 		foreach ($result['hits']['hits'] as $entry) {
103 103
 			$searchResult->addDocument($this->parseSearchEntry($entry, $access->getViewerId()));
104 104
 		}
105 105
 
106
-		$this->logger->log(0, 'Filled SearchResult Model: ' . json_encode($searchResult));
106
+		$this->logger->log(0, 'Filled SearchResult Model: '.json_encode($searchResult));
107 107
 	}
108 108
 
109 109
 
Please login to merge, or discard this patch.
lib/AppInfo/Application.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
 use OCP\AppFramework\Bootstrap\IBootstrap;
35 35
 use OCP\AppFramework\Bootstrap\IRegistrationContext;
36 36
 
37
-require_once __DIR__ . '/../../vendor/autoload.php';
37
+require_once __DIR__.'/../../vendor/autoload.php';
38 38
 
39 39
 class Application extends App implements IBootstrap {
40 40
 
Please login to merge, or discard this patch.