Skip to content

Commit fbee61e

Browse files
committed
Pint fix
1 parent aff2dae commit fbee61e

30 files changed

+250
-248
lines changed

src/Connection.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class Connection extends BaseConnection
7171

7272
protected bool $sslVerification = true;
7373

74-
protected ?int $retires = null; //null will use default
74+
protected ?int $retires = null; // null will use default
7575

7676
protected mixed $elasticMetaHeader = null;
7777

@@ -155,9 +155,9 @@ public function disconnect(): void
155155
$this->client = null;
156156
}
157157

158-
//----------------------------------------------------------------------
158+
// ----------------------------------------------------------------------
159159
// Getters
160-
//----------------------------------------------------------------------
160+
// ----------------------------------------------------------------------
161161

162162
/** {@inheritdoc} */
163163
public function getTablePrefix(): ?string
@@ -264,9 +264,9 @@ protected function getDefaultSchemaGrammar(): Schema\Grammar
264264
return new Schema\Grammar;
265265
}
266266

267-
//----------------------------------------------------------------------
267+
// ----------------------------------------------------------------------
268268
// Setters
269-
//----------------------------------------------------------------------
269+
// ----------------------------------------------------------------------
270270

271271
public function setIndex(string $index): string
272272
{

src/DSL/Bridge.php

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Bridge
2424

2525
protected ?string $errorLogger;
2626

27-
protected ?int $maxSize = 10; //ES default
27+
protected ?int $maxSize = 10; // ES default
2828

2929
private ?string $index;
3030

@@ -44,9 +44,9 @@ public function __construct(Connection $connection)
4444
$this->errorLogger = $this->connection->getErrorLoggingIndex();
4545
}
4646

47-
//======================================================================
47+
// ======================================================================
4848
// PIT
49-
//======================================================================
49+
// ======================================================================
5050

5151
/**
5252
* @throws QueryException
@@ -88,7 +88,7 @@ public function processPitFind($wheres, $options, $columns, $pitId, $searchAfter
8888
if (empty($params['body']['sort'])) {
8989
$params['body']['sort'] = [];
9090
}
91-
//order catch by shard doc
91+
// order catch by shard doc
9292
$params['body']['sort'][] = ['_shard_doc' => ['order' => 'asc']];
9393

9494
if ($searchAfter) {
@@ -126,9 +126,9 @@ public function processClosePit($id): bool
126126
return $res['succeeded'];
127127
}
128128

129-
//======================================================================
129+
// ======================================================================
130130
// BYO Query
131-
//======================================================================
131+
// ======================================================================
132132

133133
/**
134134
* @throws Exception
@@ -187,9 +187,9 @@ public function processIndicesDsl($method, $params): Results
187187
return $this->_sanitizeSearchResponse($process, $params, $this->_queryTag(__FUNCTION__));
188188
}
189189

190-
//======================================================================
190+
// ======================================================================
191191
// To DSL
192-
//======================================================================
192+
// ======================================================================
193193

194194
/**
195195
* @throws QueryException
@@ -209,9 +209,9 @@ public function processToDslForSearch($searchParams, $searchOptions, $wheres, $o
209209
return $this->buildSearchParams($this->index, $searchParams, $searchOptions, $wheres, $opts, $fields, $cols);
210210
}
211211

212-
//======================================================================
212+
// ======================================================================
213213
// Find/Search Queries
214-
//======================================================================
214+
// ======================================================================
215215

216216
/**
217217
* @throws QueryException
@@ -238,13 +238,13 @@ public function processGetId($id, $columns, $softDeleteColumn): Results
238238
try {
239239
$process = $this->client->get($params);
240240
} catch (ClientResponseException $e) {
241-
//if the error is a 404 continue, else throw it
241+
// if the error is a 404 continue, else throw it
242242
if ($e->getCode() !== 404) {
243243
$this->_throwError($e, $params, $this->_queryTag(__FUNCTION__));
244244
}
245245

246246
} catch (Exception $e) {
247-
//Something else went wrong, throw it
247+
// Something else went wrong, throw it
248248
$this->_throwError($e, $params, $this->_queryTag(__FUNCTION__));
249249
}
250250

@@ -291,9 +291,9 @@ protected function _returnSearch($params, $source): Results
291291
return $this->_sanitizeSearchResponse($process, $params, $this->_queryTag($source));
292292
}
293293

294-
//----------------------------------------------------------------------
294+
// ----------------------------------------------------------------------
295295
// Distinct
296-
//----------------------------------------------------------------------
296+
// ----------------------------------------------------------------------
297297
/**
298298
* @throws QueryException
299299
* @throws ParameterException
@@ -325,7 +325,7 @@ public function processDistinct($wheres, $options, $columns, $includeDocCount =
325325
if (! empty($response['aggregations'])) {
326326
$data = $this->_sanitizeDistinctResponse($response['aggregations'], $columns, $includeDocCount);
327327
}
328-
//process limit and skip from all results
328+
// process limit and skip from all results
329329
if ($skip || $limit) {
330330
$data = array_slice($data, $skip, $limit);
331331
}
@@ -336,9 +336,9 @@ public function processDistinct($wheres, $options, $columns, $includeDocCount =
336336
return $this->_return($data, $response, $params, $this->_queryTag(__FUNCTION__));
337337
}
338338

339-
//----------------------------------------------------------------------
339+
// ----------------------------------------------------------------------
340340
// Write Queries
341-
//----------------------------------------------------------------------
341+
// ----------------------------------------------------------------------
342342

343343
/**
344344
* @throws QueryException
@@ -513,7 +513,7 @@ public function processUpdateMany($wheres, $newValues, $options, $refresh = null
513513
*/
514514
public function processIncrementMany($wheres, $newValues, $options, $refresh): Results
515515
{
516-
//TODO INC on nested objects - maybe
516+
// TODO INC on nested objects - maybe
517517

518518
$incField = '';
519519
foreach ($newValues['inc'] as $field => $incValue) {
@@ -551,9 +551,9 @@ public function processIncrementMany($wheres, $newValues, $options, $refresh): R
551551
return $this->_return($resultData, $resultMeta, $params, $this->_queryTag(__FUNCTION__));
552552
}
553553

554-
//----------------------------------------------------------------------
554+
// ----------------------------------------------------------------------
555555
// Delete Queries
556-
//----------------------------------------------------------------------
556+
// ----------------------------------------------------------------------
557557

558558
/**
559559
* @throws QueryException
@@ -589,9 +589,9 @@ public function processDeleteAll($wheres, $options = []): Results
589589
return $this->_return($response['deleteCount'], $response, $params, $this->_queryTag(__FUNCTION__));
590590
}
591591

592-
//----------------------------------------------------------------------
592+
// ----------------------------------------------------------------------
593593
// Index administration
594-
//----------------------------------------------------------------------
594+
// ----------------------------------------------------------------------
595595

596596
/**
597597
* @throws ClientResponseException
@@ -786,9 +786,9 @@ public function processFieldMapping(string $index, string|array $field, bool $ra
786786

787787
}
788788

789-
//----------------------------------------------------------------------
789+
// ----------------------------------------------------------------------
790790
// Aggregates
791-
//----------------------------------------------------------------------
791+
// ----------------------------------------------------------------------
792792
/**
793793
* @throws QueryException
794794
* @throws ParameterException
@@ -956,9 +956,9 @@ private function _sanitizeAggsResponse($response, $params, $queryTag): Results
956956
return $this->_return($data, $meta, $params, $queryTag);
957957
}
958958

959-
//======================================================================
959+
// ======================================================================
960960
// Distinct Aggregates
961-
//======================================================================
961+
// ======================================================================
962962

963963
public function processDistinctAggregate($function, $wheres, $options, $columns): Results
964964
{
@@ -1111,9 +1111,9 @@ private function _matrixDistinctAggregate($wheres, $options, $columns)
11111111
$this->_throwError(new Exception('Matrix distinct aggregate not supported', 500), [], $this->_queryTag(__FUNCTION__));
11121112
}
11131113

1114-
//======================================================================
1114+
// ======================================================================
11151115
// Helpers
1116-
//======================================================================
1116+
// ======================================================================
11171117

11181118
/**
11191119
* @throws QueryException
@@ -1130,11 +1130,11 @@ public function parseRequiredKeywordMapping($field): ?string
11301130
$keywordFields = $this->cachedKeywordFields;
11311131

11321132
if ($keywordFields->isEmpty()) {
1133-
//No keyword fields
1133+
// No keyword fields
11341134
return null;
11351135
}
11361136
if ($keywordFields->has($field)) {
1137-
//Field is a keyword
1137+
// Field is a keyword
11381138
return $field;
11391139
}
11401140
if ($keywordFields->has($field.'.keyword')) {
@@ -1145,9 +1145,9 @@ public function parseRequiredKeywordMapping($field): ?string
11451145
return null;
11461146
}
11471147

1148-
//======================================================================
1148+
// ======================================================================
11491149
// Private & Sanitization methods
1150-
//======================================================================
1150+
// ======================================================================
11511151

11521152
private function _return($data, $meta, $params, $queryTag): Results
11531153
{
@@ -1178,7 +1178,7 @@ public function _sanitizeGetResponse($response, $params, $softDeleteColumn, $que
11781178
}
11791179

11801180
if (! $response || $softDeleted) {
1181-
//Was not found
1181+
// Was not found
11821182
$result = $this->_return($data, [], $params, $queryTag);
11831183
$result->setError($data['_id'].' not found', 404);
11841184

@@ -1250,7 +1250,7 @@ private function _sanitizeSearchResponse($response, $params, $queryTag)
12501250
}
12511251
}
12521252

1253-
//Meta data
1253+
// Meta data
12541254
if (! empty($hit['highlight'])) {
12551255
$datum['_meta']['highlights'] = $this->_sanitizeHighlights($hit['highlight']);
12561256
}
@@ -1337,7 +1337,7 @@ private function _sanitizeRawAggsResponse($response, $params, $queryTag)
13371337

13381338
private function _sanitizeHighlights($highlights)
13391339
{
1340-
//remove keyword results
1340+
// remove keyword results
13411341
foreach ($highlights as $field => $vals) {
13421342
if (str_contains($field, '.keyword')) {
13431343
$cleanField = str_replace('.keyword', '', $field);
@@ -1415,9 +1415,9 @@ private function _parseFieldMap(array $mapping): array
14151415
return $mappings->toArray();
14161416
}
14171417

1418-
//======================================================================
1418+
// ======================================================================
14191419
// Error and logging
1420-
//======================================================================
1420+
// ======================================================================
14211421

14221422
/**
14231423
* @throws QueryException
@@ -1461,13 +1461,13 @@ private function _logQuery(Results $results, $details)
14611461
try {
14621462
$this->client->index($params);
14631463
} catch (Exception $e) {
1464-
//ignore if problem writing query log
1464+
// ignore if problem writing query log
14651465
}
14661466
}
14671467

1468-
//----------------------------------------------------------------------
1468+
// ----------------------------------------------------------------------
14691469
// Meta Stasher
1470-
//----------------------------------------------------------------------
1470+
// ----------------------------------------------------------------------
14711471

14721472
private function _stashMeta($meta): void
14731473
{

src/DSL/QueryBuilder.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ trait QueryBuilder
2222
//
2323
// protected static array $clauseOperators = ['ne', 'gt', 'gte', 'lt', 'lte', 'between', 'not_between', 'like', 'not_like', 'exists', 'regex'];
2424

25-
//======================================================================
25+
// ======================================================================
2626
// Parameter builders
27-
//======================================================================
27+
// ======================================================================
2828

2929
/**
3030
* @throws ParameterException
@@ -195,9 +195,9 @@ public function addSearchToWheres($wheres, $queryString): array
195195
return ['and' => [$wheres, $clause]];
196196
}
197197

198-
//----------------------------------------------------------------------
198+
// ----------------------------------------------------------------------
199199
// Parsers
200-
//----------------------------------------------------------------------
200+
// ----------------------------------------------------------------------
201201

202202
/**
203203
* @throws ParameterException
@@ -514,7 +514,7 @@ private function _buildOptions($options): array
514514
case 'multiple':
515515
case 'searchOptions':
516516

517-
//Pass through
517+
// Pass through
518518
break;
519519
default:
520520
throw new ParameterException('Unexpected option: '.$key);
@@ -537,7 +537,7 @@ private function _buildNestedOptions($options, $field): array
537537
$options = array_merge($options, $body);
538538
}
539539
if (! empty($options['sort'])) {
540-
//ensure that the sort field is prefixed with the nested field
540+
// ensure that the sort field is prefixed with the nested field
541541
$sorts = [];
542542
foreach ($options['sort'] as $sort) {
543543
foreach ($sort as $sortField => $sortPayload) {

0 commit comments

Comments
 (0)