Skip to content

Commit fbe6f92

Browse files
committed
Automated PSR-2 style cleanup
1 parent 8238cb3 commit fbe6f92

File tree

20 files changed

+54
-47
lines changed

20 files changed

+54
-47
lines changed

.php_cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ function php_cs() {
55
->exclude('benchmarks')
66
->exclude('docs')
77
->exclude('util')
8+
->exclude('.github')
9+
->exclude('util')
10+
->exclude('travis')
11+
->exclude('util/cache')
12+
->exclude('util/elasticsearch')
13+
->exclude('vendor')
814
->in(__DIR__);
915

1016
return Symfony\CS\Config\Config::create()

src/Elasticsearch/Client.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1441,7 +1441,8 @@ public function extractArgument(&$params, $arg)
14411441
}
14421442
}
14431443

1444-
private function verifyNotNullOrEmpty($name, $var) {
1444+
private function verifyNotNullOrEmpty($name, $var)
1445+
{
14451446
if ($var === null) {
14461447
throw new InvalidArgumentException("$name cannot be null.");
14471448
}

src/Elasticsearch/ClientBuilder.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ public static function create()
106106
* @throws Common\Exceptions\RuntimeException
107107
* @return \Elasticsearch\Client
108108
*/
109-
public static function fromConfig($config, $quiet = false) {
109+
public static function fromConfig($config, $quiet = false)
110+
{
110111
$builder = new self;
111112
foreach ($config as $key => $value) {
112113
$method = "set$key";

src/Elasticsearch/ConnectionPool/SimpleConnectionPool.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,4 @@ public function nextConnection($force = false)
3232
public function scheduleCheck()
3333
{
3434
}
35-
3635
}

src/Elasticsearch/Connections/Connection.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ private function wrapHandler(callable $handler, LoggerInterface $logger, LoggerI
187187

188188
if (isset($response['error']) === true) {
189189
if ($response['error'] instanceof ConnectException || $response['error'] instanceof RingException) {
190-
191190
$this->log->warning("Curl exception encountered.");
192191

193192
$exception = $this->getCurlRetryException($request, $response);
@@ -566,7 +565,7 @@ private function process4xxError($request, $response, $ignore)
566565
$exception = new Conflict409Exception($responseBody, $statusCode);
567566
} elseif ($statusCode === 400 && strpos($responseBody, 'script_lang not supported') !== false) {
568567
$exception = new ScriptLangNotSupportedException($responseBody. $statusCode);
569-
} elseif ($statusCode === 408 ) {
568+
} elseif ($statusCode === 408) {
570569
$exception = new RequestTimeout408Exception($responseBody, $statusCode);
571570
}
572571

@@ -628,15 +627,18 @@ private function process5xxError($request, $response, $ignore)
628627
throw $exception;
629628
}
630629

631-
private function tryDeserialize400Error($response) {
630+
private function tryDeserialize400Error($response)
631+
{
632632
return $this->tryDeserializeError($response, 'Elasticsearch\Common\Exceptions\BadRequest400Exception');
633633
}
634634

635-
private function tryDeserialize500Error($response) {
635+
private function tryDeserialize500Error($response)
636+
{
636637
return $this->tryDeserializeError($response, 'Elasticsearch\Common\Exceptions\ServerErrorResponseException');
637638
}
638639

639-
private function tryDeserializeError($response, $errorClass) {
640+
private function tryDeserializeError($response, $errorClass)
641+
{
640642
$error = $this->serializer->deserialize($response['body'], $response['transfer_stats']);
641643
if (is_array($error) === true) {
642644
// 2.0 structured exceptions
@@ -655,7 +657,6 @@ private function tryDeserializeError($response, $errorClass) {
655657
$original = new $errorClass($response['body'], $response['status']);
656658

657659
return new $errorClass("$type: $cause", $response['status'], $original);
658-
659660
} elseif (isset($error['error']) === true) {
660661
// <2.0 semi-structured exceptions
661662
$original = new $errorClass($response['body'], $response['status']);
@@ -666,7 +667,6 @@ private function tryDeserializeError($response, $errorClass) {
666667
// <2.0 "i just blew up" nonstructured exception
667668
// $error is an array but we don't know the format, reuse the response body instead
668669
return new $errorClass($response['body'], $response['status']);
669-
670670
}
671671

672672
// <2.0 "i just blew up" nonstructured exception

src/Elasticsearch/Endpoints/Cat/Segments.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ protected function getMethod()
5858
{
5959
return 'GET';
6060
}
61-
}
61+
}

src/Elasticsearch/Endpoints/Indices/Flush.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ class Flush extends AbstractEndpoint
1717
{
1818
protected $synced = false;
1919

20-
public function setSynced($synced) {
20+
public function setSynced($synced)
21+
{
2122
$this->synced = $synced;
2223
}
2324

src/Elasticsearch/Endpoints/Indices/ShardStores.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ protected function getMethod()
5656
{
5757
return 'GET';
5858
}
59-
}
59+
}

src/Elasticsearch/Endpoints/Indices/Upgrade/Get.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ protected function getMethod()
6262
{
6363
return 'GET';
6464
}
65-
}
65+
}

src/Elasticsearch/Endpoints/Indices/Upgrade/Post.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ protected function getMethod()
6262
{
6363
return 'POST';
6464
}
65-
}
65+
}

0 commit comments

Comments
 (0)