@@ -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 {
0 commit comments