Skip to content

Commit 8ec9fd2

Browse files
committed
applied coding style conventions -- phpcs
1 parent cb8559d commit 8ec9fd2

File tree

2 files changed

+15
-19
lines changed

2 files changed

+15
-19
lines changed

src/Elasticsearch/ClientBuilder.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,9 @@ public function setHosts(array $hosts): ClientBuilder
338338

339339
/**
340340
* Set the APIKey for Authenication
341-
*
341+
*
342342
* @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html
343-
*
343+
*
344344
* @param string $apiKey
345345
*/
346346
public function setApiKeyAuthentication(string $apiKey)
@@ -352,9 +352,9 @@ public function setApiKeyAuthentication(string $apiKey)
352352

353353
/**
354354
* Set the APIKey Pair, consiting of the API Id and the ApiKey of the Response from /_security/api_key
355-
*
355+
*
356356
* @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html
357-
*
357+
*
358358
* @param string $id
359359
* @param string $apiKey
360360
*/
@@ -374,16 +374,16 @@ public function setConnectionParams(array $params): ClientBuilder
374374

375375
/**
376376
* Set Elastic Cloud ID to connect to Elastic Cloud
377-
*
377+
*
378378
* <b>No authentication is provided</b>
379-
*
379+
*
380380
* - set Hostname
381381
* - set best practices for the connection
382-
*
382+
*
383383
* @param string $cloudId
384384
* @param string $username, optional if using Basic Authentication
385385
* @param string $password, optional if using Basic Authentication
386-
*
386+
*
387387
* @throws Elasticsearch\Common\Exceptions\ElasticCloudIdParseException
388388
*/
389389
public function setElasticCloudId(string $cloudId, ?string $username = null, ?string $password = null)

src/Elasticsearch/Helper/ElasticCloudIdParser.php

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function __construct(string $cloudId)
4646

4747
/**
4848
* Get the Elastic Cloud Id
49-
*
49+
*
5050
* @return string
5151
*/
5252
public function getCloudId(): string
@@ -56,7 +56,7 @@ public function getCloudId(): string
5656

5757
/**
5858
* Get the Name of the Elastic Cloud Cluster
59-
*
59+
*
6060
* @return string
6161
*/
6262
public function getClusterName(): string
@@ -66,7 +66,7 @@ public function getClusterName(): string
6666

6767
/**
6868
* Get the DNS of the Elasticsearch Cluster
69-
*
69+
*
7070
* @return string
7171
*/
7272
public function getClusterDns(): string
@@ -76,26 +76,22 @@ public function getClusterDns(): string
7676

7777
/**
7878
* Parse the Elastic Cloud Params from the CloudId
79-
*
79+
*
8080
* @return void
81-
*
81+
*
8282
* @throws Elasticsearch\Common\Exceptions\ElasticCloudIdParseException
8383
*/
8484
private function parse(): void
8585
{
86-
try
87-
{
86+
try {
8887
list($name, $encoded) = explode(':', $this->cloudId);
8988
list($uri, $uuids) = explode('$', base64_decode($encoded));
9089
list($es,) = explode(':', $uuids);
9190

9291
$this->clusterName = $name;
9392
$this->clusterDns = $es . '.' . $uri;
94-
}
95-
catch(\Throwable $t)
96-
{
93+
} catch (\Throwable $t) {
9794
throw new ElasticCloudIdParseException('could not parse the Cloud ID:' . $this->cloudId);
9895
}
9996
}
100-
10197
}

0 commit comments

Comments
 (0)