Skip to content

Commit fabd2cc

Browse files
committed
Add blank line before 'return' statements to aid readability
- Normalize coding style. Part of the Symfony Coding Standards, but frequently seen alongside PSR-2 formatted projects ¯\_(ツ)_/¯
1 parent 057b1cd commit fabd2cc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+234
-0
lines changed

src/Elasticsearch/Client.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ public function info($params = [])
9292
/** @var \Elasticsearch\Endpoints\Info $endpoint */
9393
$endpoint = $endpointBuilder('Info');
9494
$response = $endpoint->setParams($params)->performRequest();
95+
9596
return $endpoint->resultOrFuture($response);
9697
}
9798

@@ -156,6 +157,7 @@ public function get($params)
156157
->setType($type);
157158
$endpoint->setParams($params);
158159
$response = $endpoint->performRequest();
160+
159161
return $endpoint->resultOrFuture($response);
160162
}
161163

@@ -198,6 +200,7 @@ public function getSource($params)
198200
->returnOnlySource();
199201
$endpoint->setParams($params);
200202
$response = $endpoint->performRequest();
203+
201204
return $endpoint->resultOrFuture($response);
202205
}
203206

@@ -240,6 +243,7 @@ public function delete($params)
240243
->setType($type);
241244
$endpoint->setParams($params);
242245
$response = $endpoint->performRequest();
246+
243247
return $endpoint->resultOrFuture($response);
244248
}
245249

@@ -277,6 +281,7 @@ public function deleteByQuery($params = array())
277281
->setBody($body);
278282
$endpoint->setParams($params);
279283
$response = $endpoint->performRequest();
284+
280285
return $endpoint->resultOrFuture($response);
281286
}
282287

@@ -319,6 +324,7 @@ public function count($params = array())
319324
->setBody($body);
320325
$endpoint->setParams($params);
321326
$response = $endpoint->performRequest();
327+
322328
return $endpoint->resultOrFuture($response);
323329
}
324330

@@ -359,6 +365,7 @@ public function countPercolate($params = array())
359365
->setBody($body);
360366
$endpoint->setParams($params);
361367
$response = $endpoint->performRequest();
368+
362369
return $endpoint->resultOrFuture($response);
363370
}
364371

@@ -393,6 +400,7 @@ public function percolate($params)
393400
->setBody($body);
394401
$endpoint->setParams($params);
395402
$response = $endpoint->performRequest();
403+
396404
return $endpoint->resultOrFuture($response);
397405
}
398406

@@ -425,6 +433,7 @@ public function mpercolate($params = array())
425433
->setBody($body);
426434
$endpoint->setParams($params);
427435
$response = $endpoint->performRequest();
436+
428437
return $endpoint->resultOrFuture($response);
429438
}
430439

@@ -465,6 +474,7 @@ public function termvector($params = array())
465474
->setBody($body);
466475
$endpoint->setParams($params);
467476
$response = $endpoint->performRequest();
477+
468478
return $endpoint->resultOrFuture($response);
469479
}
470480

@@ -504,6 +514,7 @@ public function mtermvectors($params = array())
504514
->setBody($body);
505515
$endpoint->setParams($params);
506516
$response = $endpoint->performRequest();
517+
507518
return $endpoint->resultOrFuture($response);
508519
}
509520

@@ -604,6 +615,7 @@ public function mlt($params)
604615
->setBody($body);
605616
$endpoint->setParams($params);
606617
$response = $endpoint->performRequest();
618+
607619
return $endpoint->resultOrFuture($response);
608620
}
609621

@@ -648,6 +660,7 @@ public function mget($params = array())
648660
->setBody($body);
649661
$endpoint->setParams($params);
650662
$response = $endpoint->performRequest();
663+
651664
return $endpoint->resultOrFuture($response);
652665
}
653666

@@ -684,6 +697,7 @@ public function msearch($params = array())
684697
->setBody($body);
685698
$endpoint->setParams($params);
686699
$response = $endpoint->performRequest();
700+
687701
return $endpoint->resultOrFuture($response);
688702
}
689703

@@ -736,6 +750,7 @@ public function create($params)
736750
->createIfAbsent();
737751
$endpoint->setParams($params);
738752
$response = $endpoint->performRequest();
753+
739754
return $endpoint->resultOrFuture($response);
740755
}
741756

@@ -774,6 +789,7 @@ public function bulk($params = array())
774789
->setBody($body);
775790
$endpoint->setParams($params);
776791
$response = $endpoint->performRequest();
792+
777793
return $endpoint->resultOrFuture($response);
778794
}
779795

@@ -826,6 +842,7 @@ public function index($params)
826842
->setBody($body);
827843
$endpoint->setParams($params);
828844
$response = $endpoint->performRequest();
845+
829846
return $endpoint->resultOrFuture($response);
830847
}
831848

@@ -860,6 +877,7 @@ public function suggest($params = array())
860877
->setBody($body);
861878
$endpoint->setParams($params);
862879
$response = $endpoint->performRequest();
880+
863881
return $endpoint->resultOrFuture($response);
864882
}
865883

@@ -915,6 +933,7 @@ public function explain($params)
915933
->setBody($body);
916934
$endpoint->setParams($params);
917935
$response = $endpoint->performRequest();
936+
918937
return $endpoint->resultOrFuture($response);
919938
}
920939

@@ -1006,6 +1025,7 @@ public function searchShards($params = array())
10061025
->setType($type);
10071026
$endpoint->setParams($params);
10081027
$response = $endpoint->performRequest();
1028+
10091029
return $endpoint->resultOrFuture($response);
10101030
}
10111031

@@ -1034,6 +1054,7 @@ public function searchTemplate($params = array())
10341054
->setBody($body);
10351055
$endpoint->setParams($params);
10361056
$response = $endpoint->performRequest();
1057+
10371058
return $endpoint->resultOrFuture($response);
10381059
}
10391060

@@ -1062,6 +1083,7 @@ public function scroll($params = array())
10621083
->setBody($body);
10631084
$endpoint->setParams($params);
10641085
$response = $endpoint->performRequest();
1086+
10651087
return $endpoint->resultOrFuture($response);
10661088
}
10671089

@@ -1091,6 +1113,7 @@ public function clearScroll($params = array())
10911113
->setClearScroll(true);
10921114
$endpoint->setParams($params);
10931115
$response = $endpoint->performRequest();
1116+
10941117
return $endpoint->resultOrFuture($response);
10951118
}
10961119

@@ -1145,6 +1168,7 @@ public function update($params)
11451168
->setBody($body);
11461169
$endpoint->setParams($params);
11471170
$response = $endpoint->performRequest();
1171+
11481172
return $endpoint->resultOrFuture($response);
11491173
}
11501174

@@ -1171,6 +1195,7 @@ public function getScript($params)
11711195
->setLang($lang);
11721196
$endpoint->setParams($params);
11731197
$response = $endpoint->performRequest();
1198+
11741199
return $endpoint->resultOrFuture($response);
11751200
}
11761201

@@ -1196,6 +1221,7 @@ public function deleteScript($params)
11961221
->setLang($lang);
11971222
$endpoint->setParams($params);
11981223
$response = $endpoint->performRequest();
1224+
11991225
return $endpoint->resultOrFuture($response);
12001226
}
12011227

@@ -1223,6 +1249,7 @@ public function putScript($params)
12231249
->setBody($body);
12241250
$endpoint->setParams($params);
12251251
$response = $endpoint->performRequest();
1252+
12261253
return $endpoint->resultOrFuture($response);
12271254
}
12281255

@@ -1245,6 +1272,7 @@ public function getTemplate($params)
12451272
$endpoint->setID($id);
12461273
$endpoint->setParams($params);
12471274
$response = $endpoint->performRequest();
1275+
12481276
return $endpoint->resultOrFuture($response);
12491277
}
12501278

@@ -1267,6 +1295,7 @@ public function deleteTemplate($params)
12671295
$endpoint->setID($id);
12681296
$endpoint->setParams($params);
12691297
$response = $endpoint->performRequest();
1298+
12701299
return $endpoint->resultOrFuture($response);
12711300
}
12721301

@@ -1291,6 +1320,7 @@ public function putTemplate($params)
12911320
->setBody($body);
12921321
$endpoint->setParams($params);
12931322
$response = $endpoint->performRequest();
1323+
12941324
return $endpoint->resultOrFuture($response);
12951325
}
12961326

@@ -1367,6 +1397,7 @@ public function extractArgument(&$params, $arg)
13671397
if (isset($params[$arg]) === true) {
13681398
$val = $params[$arg];
13691399
unset($params[$arg]);
1400+
13701401
return $val;
13711402
} else {
13721403
return null;

src/Elasticsearch/ClientBuilder.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ public static function defaultHandler($multiParams = [], $singleParams = [])
100100
} else {
101101
throw new \RuntimeException('Elasticsearch-PHP requires cURL, or a custom HTTP handler.');
102102
}
103+
103104
return $future ? Middleware::wrapFuture($default, $future) : $default;
104105
}
105106

@@ -141,6 +142,7 @@ public static function defaultLogger($path, $level = Logger::WARNING)
141142
$processor = new IntrospectionProcessor();
142143
$log->pushHandler($handler);
143144
$log->pushProcessor($processor);
145+
144146
return $log;
145147
}
146148

@@ -155,6 +157,7 @@ public static function defaultLogger($path, $level = Logger::WARNING)
155157
public function setConnectionFactory(ConnectionFactoryInterface $connectionFactory)
156158
{
157159
$this->connectionFactory = $connectionFactory;
160+
158161
return $this;
159162
}
160163

@@ -174,6 +177,7 @@ public function setConnectionPool($connectionPool, array $args = null)
174177
} else {
175178
throw new InvalidArgumentException("Serializer must be a class path or instantiated object extending AbstractConnectionPool");
176179
}
180+
177181
return $this;
178182
}
179183

@@ -184,6 +188,7 @@ public function setConnectionPool($connectionPool, array $args = null)
184188
public function setEndpoint($endpoint)
185189
{
186190
$this->endpoint = $endpoint;
191+
187192
return $this;
188193
}
189194

@@ -194,6 +199,7 @@ public function setEndpoint($endpoint)
194199
public function setTransport($transport)
195200
{
196201
$this->transport = $transport;
202+
197203
return $this;
198204
}
199205

@@ -204,6 +210,7 @@ public function setTransport($transport)
204210
public function setHandler($handler)
205211
{
206212
$this->handler = $handler;
213+
207214
return $this;
208215
}
209216

@@ -214,6 +221,7 @@ public function setHandler($handler)
214221
public function setLogger($logger)
215222
{
216223
$this->logger = $logger;
224+
217225
return $this;
218226
}
219227

@@ -224,6 +232,7 @@ public function setLogger($logger)
224232
public function setTracer($tracer)
225233
{
226234
$this->tracer = $tracer;
235+
227236
return $this;
228237
}
229238

@@ -235,6 +244,7 @@ public function setTracer($tracer)
235244
public function setSerializer($serializer)
236245
{
237246
$this->parseStringOrObject($serializer, $this->serializer, 'SerializerInterface');
247+
238248
return $this;
239249
}
240250

@@ -245,6 +255,7 @@ public function setSerializer($serializer)
245255
public function setHosts($hosts)
246256
{
247257
$this->hosts = $hosts;
258+
248259
return $this;
249260
}
250261

@@ -255,6 +266,7 @@ public function setHosts($hosts)
255266
public function setRetries($retries)
256267
{
257268
$this->retries = $retries;
269+
258270
return $this;
259271
}
260272

@@ -266,6 +278,7 @@ public function setRetries($retries)
266278
public function setSelector($selector)
267279
{
268280
$this->parseStringOrObject($selector, $this->selector, 'SelectorInterface');
281+
269282
return $this;
270283
}
271284

@@ -276,6 +289,7 @@ public function setSelector($selector)
276289
public function setSniffOnStart($sniffOnStart)
277290
{
278291
$this->sniffOnStart = $sniffOnStart;
292+
279293
return $this;
280294
}
281295

@@ -287,6 +301,7 @@ public function setSniffOnStart($sniffOnStart)
287301
public function setSSLCert($cert, $password = null)
288302
{
289303
$this->sslCert = [$cert, $password];
304+
290305
return $this;
291306
}
292307

@@ -298,6 +313,7 @@ public function setSSLCert($cert, $password = null)
298313
public function setSSLKey($key, $password = null)
299314
{
300315
$this->sslKey = [$key, $password];
316+
301317
return $this;
302318
}
303319

@@ -308,6 +324,7 @@ public function setSSLKey($key, $password = null)
308324
public function setSSLVerification($value = true)
309325
{
310326
$this->sslVerification = $value;
327+
311328
return $this;
312329
}
313330

@@ -511,6 +528,7 @@ private function prependMissingScheme($host)
511528
if (!filter_var($host, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED)) {
512529
$host = 'http://' . $host;
513530
}
531+
514532
return $host;
515533
}
516534
}

src/Elasticsearch/ConnectionPool/SniffingConnectionPool.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ private function sniffConnection(Connection $connection)
122122
}
123123

124124
$this->nextSniff = time() + $this->sniffingInterval;
125+
125126
return true;
126127
}
127128

0 commit comments

Comments
 (0)