From a4b605eeade4cd4051c3dc9149fb65c1bae707ed Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Thu, 8 Feb 2024 07:27:34 +0100 Subject: [PATCH] apply php cs --- src/Query/Mysql/Cast.php | 4 ++-- src/Query/Mysql/ConcatWs.php | 4 ++-- src/Query/Mysql/CountIf.php | 2 +- src/Query/Mysql/Field.php | 2 +- src/Query/Mysql/Greatest.php | 2 +- src/Query/Mysql/GroupConcat.php | 2 +- src/Query/Mysql/Least.php | 2 +- src/Query/Mysql/MatchAgainst.php | 8 ++++---- src/Query/Oracle/Listagg.php | 8 ++++---- src/Query/Postgresql/Greatest.php | 2 +- src/Query/Postgresql/Least.php | 2 +- src/Query/SortableNullsWalker.php | 4 ++-- src/Query/Sqlite/ConcatWs.php | 4 ++-- src/Query/Sqlite/Greatest.php | 2 +- src/Query/Sqlite/Least.php | 2 +- 15 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/Query/Mysql/Cast.php b/src/Query/Mysql/Cast.php index ac5c8fd7..07a214ec 100644 --- a/src/Query/Mysql/Cast.php +++ b/src/Query/Mysql/Cast.php @@ -49,8 +49,8 @@ public function parse(Parser $parser): void $parameters = [$parameter->value]; if ($parser->getLexer()->isNextToken(TokenType::T_COMMA)) { - while ($parser->getLexer()->isNextToken(TokenType::T_COMMA)) { - $parser->match(TokenType::T_COMMA); + while ($parser->getLexer()->isNextToken(TokenType::T_COMMA)) { + $parser->match(TokenType::T_COMMA); $parameter = $parser->Literal(); $parameters[] = $parameter->value; } diff --git a/src/Query/Mysql/ConcatWs.php b/src/Query/Mysql/ConcatWs.php index 5707400f..b351b687 100644 --- a/src/Query/Mysql/ConcatWs.php +++ b/src/Query/Mysql/ConcatWs.php @@ -43,7 +43,7 @@ public function parse(Parser $parser): void while ($lexer->lookahead->type === TokenType::T_IDENTIFIER) { switch (strtolower($lexer->lookahead->value)) { - case 'notempty': + case 'notempty': $parser->match(TokenType::T_IDENTIFIER); $this->notEmpty = true; @@ -66,7 +66,7 @@ public function getSql(SqlWalker $sqlWalker): string // Iterate over the captured expressions and add them to the query. for ($i = 0; $i < count($this->values); $i++) { if ($i > 0) { - $queryBuilder[] = ', '; + $queryBuilder[] = ', '; } // Dispatch the walker on the current node. diff --git a/src/Query/Mysql/CountIf.php b/src/Query/Mysql/CountIf.php index aedbe2ce..9e5714bf 100644 --- a/src/Query/Mysql/CountIf.php +++ b/src/Query/Mysql/CountIf.php @@ -31,7 +31,7 @@ public function parse(Parser $parser): void while ($lexer->lookahead->type === TokenType::T_IDENTIFIER) { switch (strtolower($lexer->lookahead->value)) { - case 'inverse': + case 'inverse': $parser->match(TokenType::T_IDENTIFIER); $this->inverse = true; diff --git a/src/Query/Mysql/Field.php b/src/Query/Mysql/Field.php index a5ccb246..ba8b219a 100644 --- a/src/Query/Mysql/Field.php +++ b/src/Query/Mysql/Field.php @@ -50,7 +50,7 @@ public function getSql(SqlWalker $sqlWalker): string for ($i = 0; $i < count($this->values); $i++) { if ($i > 0) { - $query .= ', '; + $query .= ', '; } $query .= $this->values[$i]->dispatch($sqlWalker); diff --git a/src/Query/Mysql/Greatest.php b/src/Query/Mysql/Greatest.php index b8aa1e28..5a2fbdf1 100644 --- a/src/Query/Mysql/Greatest.php +++ b/src/Query/Mysql/Greatest.php @@ -47,7 +47,7 @@ public function getSql(SqlWalker $sqlWalker): string for ($i = 0; $i < count($this->values); $i++) { if ($i > 0) { - $query .= ', '; + $query .= ', '; } $query .= $this->values[$i]->dispatch($sqlWalker); diff --git a/src/Query/Mysql/GroupConcat.php b/src/Query/Mysql/GroupConcat.php index db080fc3..6312414f 100644 --- a/src/Query/Mysql/GroupConcat.php +++ b/src/Query/Mysql/GroupConcat.php @@ -52,7 +52,7 @@ public function parse(Parser $parser): void if ($lexer->isNextToken(TokenType::T_IDENTIFIER)) { if (strtolower($lexer->lookahead->value) !== 'separator') { - $parser->syntaxError('separator'); + $parser->syntaxError('separator'); } $parser->match(TokenType::T_IDENTIFIER); diff --git a/src/Query/Mysql/Least.php b/src/Query/Mysql/Least.php index 0dd8ff89..1347b2f0 100644 --- a/src/Query/Mysql/Least.php +++ b/src/Query/Mysql/Least.php @@ -44,7 +44,7 @@ public function getSql(SqlWalker $sqlWalker): string for ($i = 0; $i < count($this->values); $i++) { if ($i > 0) { - $query .= ', '; + $query .= ', '; } $query .= $this->values[$i]->dispatch($sqlWalker); diff --git a/src/Query/Mysql/MatchAgainst.php b/src/Query/Mysql/MatchAgainst.php index 9c629560..a555b4b0 100644 --- a/src/Query/Mysql/MatchAgainst.php +++ b/src/Query/Mysql/MatchAgainst.php @@ -61,13 +61,13 @@ public function parse(Parser $parser): void $parser->match(TokenType::T_IDENTIFIER); if (strtolower($lexer->lookahead->value) !== 'boolean') { - $parser->syntaxError('boolean'); + $parser->syntaxError('boolean'); } $parser->match(TokenType::T_IDENTIFIER); if (strtolower($lexer->lookahead->value) !== 'mode') { - $parser->syntaxError('mode'); + $parser->syntaxError('mode'); } $parser->match(TokenType::T_IDENTIFIER); @@ -82,13 +82,13 @@ public function parse(Parser $parser): void $parser->match(TokenType::T_IDENTIFIER); if (strtolower($lexer->lookahead->value) !== 'query') { - $parser->syntaxError('query'); + $parser->syntaxError('query'); } $parser->match(TokenType::T_IDENTIFIER); if (strtolower($lexer->lookahead->value) !== 'expansion') { - $parser->syntaxError('expansion'); + $parser->syntaxError('expansion'); } $parser->match(TokenType::T_IDENTIFIER); diff --git a/src/Query/Oracle/Listagg.php b/src/Query/Oracle/Listagg.php index 0ba51f56..2d01cb6f 100644 --- a/src/Query/Oracle/Listagg.php +++ b/src/Query/Oracle/Listagg.php @@ -56,14 +56,14 @@ public function parse(Parser $parser): void if ($lexer->isNextToken(TokenType::T_IDENTIFIER)) { if (strtolower($lexer->lookahead->value) !== 'over') { - $parser->syntaxError('OVER'); + $parser->syntaxError('OVER'); } $parser->match(TokenType::T_IDENTIFIER); $parser->match(TokenType::T_OPEN_PARENTHESIS); if (! $lexer->isNextToken(TokenType::T_IDENTIFIER) || strtolower($lexer->lookahead->value) !== 'partition') { - $parser->syntaxError('PARTITION BY'); + $parser->syntaxError('PARTITION BY'); } $parser->match(TokenType::T_IDENTIFIER); @@ -72,7 +72,7 @@ public function parse(Parser $parser): void $this->partitionBy[] = $parser->StringPrimary(); while ($lexer->isNextToken(TokenType::T_COMMA)) { - $parser->match(TokenType::T_COMMA); + $parser->match(TokenType::T_COMMA); $this->partitionBy[] = $parser->StringPrimary(); } @@ -94,7 +94,7 @@ public function getSql(SqlWalker $sqlWalker): string if (count($this->partitionBy)) { $partitionBy = []; foreach ($this->partitionBy as $part) { - $partitionBy[] = $part->dispatch($sqlWalker); + $partitionBy[] = $part->dispatch($sqlWalker); } $result .= ' PARTITION BY (' . implode(',', $partitionBy) . ')'; diff --git a/src/Query/Postgresql/Greatest.php b/src/Query/Postgresql/Greatest.php index b60d0f57..652fafd8 100644 --- a/src/Query/Postgresql/Greatest.php +++ b/src/Query/Postgresql/Greatest.php @@ -48,7 +48,7 @@ public function getSql(SqlWalker $sqlWalker): string for ($i = 0; $i < count($this->values); $i++) { if ($i > 0) { - $query .= ', '; + $query .= ', '; } $query .= $this->values[$i]->dispatch($sqlWalker); diff --git a/src/Query/Postgresql/Least.php b/src/Query/Postgresql/Least.php index 75ec1419..f5986bcb 100644 --- a/src/Query/Postgresql/Least.php +++ b/src/Query/Postgresql/Least.php @@ -47,7 +47,7 @@ public function getSql(SqlWalker $sqlWalker): string for ($i = 0; $i < count($this->values); $i++) { if ($i > 0) { - $query .= ', '; + $query .= ', '; } $query .= $this->values[$i]->dispatch($sqlWalker); diff --git a/src/Query/SortableNullsWalker.php b/src/Query/SortableNullsWalker.php index 317bbeb7..98b9b47b 100644 --- a/src/Query/SortableNullsWalker.php +++ b/src/Query/SortableNullsWalker.php @@ -53,12 +53,12 @@ public function walkOrderByItem($orderByItem): string $expr instanceof Query\AST\PathExpression && $expr->type === Query\AST\PathExpression::TYPE_STATE_FIELD ) { - $fieldName = $expr->field; + $fieldName = $expr->field; $dqlAlias = $expr->identificationVariable; $search = $this->walkPathExpression($expr) . ' ' . $type; $index = $dqlAlias . '.' . $fieldName; if (isset($hint[$index])) { - $sql = str_replace($search, $search . ' ' . $hint[$index], $sql); + $sql = str_replace($search, $search . ' ' . $hint[$index], $sql); } } } diff --git a/src/Query/Sqlite/ConcatWs.php b/src/Query/Sqlite/ConcatWs.php index 845b24e7..72873d1c 100644 --- a/src/Query/Sqlite/ConcatWs.php +++ b/src/Query/Sqlite/ConcatWs.php @@ -43,7 +43,7 @@ public function parse(Parser $parser): void while ($lexer->lookahead->type === TokenType::T_IDENTIFIER) { switch (strtolower($lexer->lookahead->value)) { - case 'notempty': + case 'notempty': $parser->match(TokenType::T_IDENTIFIER); $this->notEmpty = true; @@ -68,7 +68,7 @@ public function getSql(SqlWalker $sqlWalker): string // Iterate over the captured expressions and add them to the query. for ($i = 1; $i < count($this->values); $i++) { if ($i > 1) { - $queryBuilder[] = ' || \'' . $separator . '\' || '; + $queryBuilder[] = ' || \'' . $separator . '\' || '; } // Dispatch the walker on the current node. diff --git a/src/Query/Sqlite/Greatest.php b/src/Query/Sqlite/Greatest.php index a0c3910c..a2e11a9b 100644 --- a/src/Query/Sqlite/Greatest.php +++ b/src/Query/Sqlite/Greatest.php @@ -47,7 +47,7 @@ public function getSql(SqlWalker $sqlWalker): string for ($i = 0; $i < count($this->values); $i++) { if ($i > 0) { - $query .= ', '; + $query .= ', '; } $query .= $this->values[$i]->dispatch($sqlWalker); diff --git a/src/Query/Sqlite/Least.php b/src/Query/Sqlite/Least.php index 73583cc5..80de38a2 100644 --- a/src/Query/Sqlite/Least.php +++ b/src/Query/Sqlite/Least.php @@ -44,7 +44,7 @@ public function getSql(SqlWalker $sqlWalker): string for ($i = 0; $i < count($this->values); $i++) { if ($i > 0) { - $query .= ', '; + $query .= ', '; } $query .= $this->values[$i]->dispatch($sqlWalker);