Completed
Pull Request — master (#282)
by Maxence
16s
created
lib/Platform/ElasticSearchPlatform.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 	 * @throws Exception
132 132
 	 */
133 133
 	public function loadPlatform() {
134
-        $this->connectToElastic($this->configService->getElasticHost());
134
+		$this->connectToElastic($this->configService->getElasticHost());
135 135
 	}
136 136
 
137 137
 
@@ -383,29 +383,29 @@  discard block
 block discarded – undo
383 383
 	 * @throws Exception
384 384
 	 */
385 385
 	private function connectToElastic(array $hosts): void {
386
-        $hosts = array_map([$this, 'cleanHost'], $hosts);
387
-        $cb = ClientBuilder::create()
388
-            ->setHosts($hosts)
389
-            ->setRetries(3);
390
-        $this->configureAuthentication($cb, $hosts);
391
-
392
-        $this->client = $cb->build();
393
-    }
394
-
395
-    /**
396
-     * setBasicAuthentication() on ClientBuilder if available, using list of hosts
397
-     */
398
-    private function configureAuthentication(ClientBuilder $cb, array $hosts): void {
399
-        foreach ($hosts as $host) {
400
-            $user = parse_url($host, PHP_URL_USER) ?? '';
401
-            $pass = parse_url($host, PHP_URL_PASS) ?? '';
402
-
403
-            if ($user !== '' || $pass !== '') {
404
-                $cb->setBasicAuthentication($user, $pass);
405
-                return;
406
-            }
407
-        }
408
-    }
386
+		$hosts = array_map([$this, 'cleanHost'], $hosts);
387
+		$cb = ClientBuilder::create()
388
+			->setHosts($hosts)
389
+			->setRetries(3);
390
+		$this->configureAuthentication($cb, $hosts);
391
+
392
+		$this->client = $cb->build();
393
+	}
394
+
395
+	/**
396
+	 * setBasicAuthentication() on ClientBuilder if available, using list of hosts
397
+	 */
398
+	private function configureAuthentication(ClientBuilder $cb, array $hosts): void {
399
+		foreach ($hosts as $host) {
400
+			$user = parse_url($host, PHP_URL_USER) ?? '';
401
+			$pass = parse_url($host, PHP_URL_PASS) ?? '';
402
+
403
+			if ($user !== '' || $pass !== '') {
404
+				$cb->setBasicAuthentication($user, $pass);
405
+				return;
406
+			}
407
+		}
408
+	}
409 409
 
410 410
 
411 411
 	/**
Please login to merge, or discard this patch.