Completed
Pull Request — master (#100)
by Robin
32s
created
lib/Platform/ElasticSearchPlatform.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -126,12 +126,12 @@
 block discarded – undo
126 126
 		$hosts = $this->configService->getElasticHost();
127 127
 		foreach ($hosts as $host) {
128 128
 			$parsedHost = parse_url($host);
129
-			$safeHost = $parsedHost['scheme'] . '://';
129
+			$safeHost = $parsedHost['scheme'].'://';
130 130
 			if (array_key_exists('user', $parsedHost)) {
131
-				$safeHost .= $parsedHost['user'] . ':' . '********' . '@';
131
+				$safeHost .= $parsedHost['user'].':'.'********'.'@';
132 132
 			}
133 133
 			$safeHost .= $parsedHost['host'];
134
-			$safeHost .= ':' . $parsedHost['port'];
134
+			$safeHost .= ':'.$parsedHost['port'];
135 135
 
136 136
 			$sanitizedHosts[] = $safeHost;
137 137
 		}
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
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 		Client $client, ISearchResult $searchResult, IDocumentAccess $access
86 86
 	) {
87 87
 		try {
88
-			$this->miscService->log('New Search Request; SearchResult Model: ' . json_encode($searchResult), 0);
88
+			$this->miscService->log('New Search Request; SearchResult Model: '.json_encode($searchResult), 0);
89 89
 			$query = $this->searchMappingService->generateSearchQuery(
90 90
 				$searchResult->getRequest(), $access, $searchResult->getProvider()
91 91
 																   ->getId()
@@ -95,25 +95,25 @@  discard block
 block discarded – undo
95 95
 		}
96 96
 
97 97
 		try {
98
-			$this->miscService->log('Searching ES: ' . json_encode($query['params']), 0);
98
+			$this->miscService->log('Searching ES: '.json_encode($query['params']), 0);
99 99
 
100 100
 			$result = $client->search($query['params']);
101 101
 		} catch (Exception $e) {
102 102
 			$this->miscService->log(
103
-				'debug - request: ' . json_encode($searchResult->getRequest()) . '   - query: '
103
+				'debug - request: '.json_encode($searchResult->getRequest()).'   - query: '
104 104
 				. json_encode($query)
105 105
 			);
106 106
 			throw $e;
107 107
 		}
108 108
 
109
-		$this->miscService->log('Result from ES: ' . json_encode($result), 0);
109
+		$this->miscService->log('Result from ES: '.json_encode($result), 0);
110 110
 		$this->updateSearchResult($searchResult, $result);
111 111
 
112 112
 		foreach ($result['hits']['hits'] as $entry) {
113 113
 			$searchResult->addDocument($this->parseSearchEntry($entry, $access->getViewerId()));
114 114
 		}
115 115
 
116
-		$this->miscService->log('Filled SearchResult Model: ' . json_encode($searchResult), 0);
116
+		$this->miscService->log('Filled SearchResult Model: '.json_encode($searchResult), 0);
117 117
 	}
118 118
 
119 119
 
Please login to merge, or discard this patch.
lib/Service/IUserStoragesService.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -30,9 +30,9 @@
 block discarded – undo
30 30
 namespace OCA\FullTextSearch_ElasticSearch\Service;
31 31
 
32 32
 interface IUserStoragesService {
33
-    /**
34
-     * Returns an array of strings with all external mountpoints of the current user
35
-     * @return array
36
-     */
37
-    function getAllStoragesForUser();
33
+	/**
34
+	 * Returns an array of strings with all external mountpoints of the current user
35
+	 * @return array
36
+	 */
37
+	function getAllStoragesForUser();
38 38
 }
39 39
\ No newline at end of file
Please login to merge, or discard this patch.
lib/Service/UserStoragesService.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -36,19 +36,19 @@  discard block
 block discarded – undo
36 36
  */
37 37
 class UserStoragesService implements IUserStoragesService {
38 38
     
39
-    /** @var UserGlobalStoragesService */
40
-    private $userGlobalStoragesService;
39
+	/** @var UserGlobalStoragesService */
40
+	private $userGlobalStoragesService;
41 41
 
42
-    public function __construct(UserGlobalStoragesService $userGlobalStoragesService) {
43
-        $this->userGlobalStoragesService = $userGlobalStoragesService;
44
-    }
42
+	public function __construct(UserGlobalStoragesService $userGlobalStoragesService) {
43
+		$this->userGlobalStoragesService = $userGlobalStoragesService;
44
+	}
45 45
 
46 46
    /**
47
-     * Returns an array of strings with all external mountpoints of the current user
48
-     * @return array
49
-     */
50
-    public function getAllStoragesForUser() {
51
-        $userStorages = $this->userGlobalStoragesService->getAllStoragesForUser();
47
+    * Returns an array of strings with all external mountpoints of the current user
48
+    * @return array
49
+    */
50
+	public function getAllStoragesForUser() {
51
+		$userStorages = $this->userGlobalStoragesService->getAllStoragesForUser();
52 52
 		$mountPoints = [];
53 53
 		foreach($userStorages as $userStorage){
54 54
 			/** @var $userStorage OCA\Files_External\Lib\StorageConfig */
@@ -62,5 +62,5 @@  discard block
 block discarded – undo
62 62
 			$mountPoints[] = $mountPoint;
63 63
 		}
64 64
 		return $mountPoints;
65
-    }
65
+	}
66 66
 }
67 67
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -50,13 +50,13 @@
 block discarded – undo
50 50
     public function getAllStoragesForUser() {
51 51
         $userStorages = $this->userGlobalStoragesService->getAllStoragesForUser();
52 52
 		$mountPoints = [];
53
-		foreach($userStorages as $userStorage){
53
+		foreach ($userStorages as $userStorage) {
54 54
 			/** @var $userStorage OCA\Files_External\Lib\StorageConfig */
55 55
 			$mountPoint = $userStorage->getMountPoint();
56
-			if (substr($mountPoint, 0, 1) === '/'){
56
+			if (substr($mountPoint, 0, 1) === '/') {
57 57
 				$mountPoint = substr($mountPoint, 1, strlen($mountPoint) - 1);
58 58
 			}
59
-			if (substr($mountPoint, strlen($mountPoint) - 1, 1) !== '/'){
59
+			if (substr($mountPoint, strlen($mountPoint) - 1, 1) !== '/') {
60 60
 				$mountPoint .= '/';
61 61
 			}
62 62
 			$mountPoints[] = $mountPoint;
Please login to merge, or discard this patch.
lib/AppInfo/Application.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 use OCA\Files_External\Service\UserGlobalStoragesService;
43 43
 
44 44
 
45
-require_once __DIR__ . '/../../vendor/autoload.php';
45
+require_once __DIR__.'/../../vendor/autoload.php';
46 46
 
47 47
 
48 48
 /**
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 		// Make SearchMappingService also work without external storage
73 73
 		// if app is inactive or not installed.
74 74
 		$context->registerService(SearchMappingService::class, function($c) {
75
-			try{
75
+			try {
76 76
 				$userStoragesService = $c->query(UserGlobalStoragesService::class);
77 77
 				return new SearchMappingService(
78 78
 					$c->query(ConfigService::class),
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,8 +79,7 @@
 block discarded – undo
79 79
 					$c->query(MiscService::class),
80 80
 					new UserStoragesService($userStoragesService)
81 81
 				);
82
-			}
83
-			catch (\Psr\Container\ContainerExceptionInterface $e) {
82
+			} catch (\Psr\Container\ContainerExceptionInterface $e) {
84 83
 				return new SearchMappingService(
85 84
 					$c->query(ConfigService::class),
86 85
 					$c->query(MiscService::class)
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
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 			'index' =>
79 79
 				[
80 80
 					'index' => $this->configService->getElasticIndex(),
81
-					'id'    => $document->getProviderId() . ':' . $document->getId(),
81
+					'id'    => $document->getProviderId().':'.$document->getId(),
82 82
 					'body'  => $this->generateIndexBody($document)
83 83
 				]
84 84
 		];
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 			'index' =>
103 103
 				[
104 104
 					'index' => $this->configService->getElasticIndex(),
105
-					'id'    => $document->getProviderId() . ':' . $document->getId(),
105
+					'id'    => $document->getProviderId().':'.$document->getId(),
106 106
 					'body'  => ['doc' => $this->generateIndexBody($document)]
107 107
 				]
108 108
 		];
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 			'index' =>
129 129
 				[
130 130
 					'index' => $this->configService->getElasticIndex(),
131
-					'id'    => $providerId . ':' . $documentId,
131
+					'id'    => $providerId.':'.$documentId,
132 132
 				]
133 133
 		];
134 134
 
Please login to merge, or discard this patch.
lib/Service/SearchMappingService.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 
288 288
 		foreach ($request->getWildcardFields() as $field) {
289 289
 			if (!$this->fieldIsOutLimit($request, $field)) {
290
-				$queryFields[] = ['wildcard' => [$field => '*' . $content->getWord() . '*']];
290
+				$queryFields[] = ['wildcard' => [$field => '*'.$content->getWord().'*']];
291 291
 			}
292 292
 		}
293 293
 
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 	public function getDocumentQuery(string $providerId, string $documentId): array {
455 455
 		return [
456 456
 			'index' => $this->configService->getElasticIndex(),
457
-			'id'    => $providerId . ':' . $documentId
457
+			'id'    => $providerId.':'.$documentId
458 458
 		];
459 459
 	}
460 460
 
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
 	private function getPartsFields(ISearchRequest $request) {
468 468
 		return array_map(
469 469
 			function($value) {
470
-				return 'parts.' . $value;
470
+				return 'parts.'.$value;
471 471
 			}, $request->getParts()
472 472
 		);
473 473
 	}
Please login to merge, or discard this patch.