Skip to content

Commit

Permalink
apply php cs
Browse files Browse the repository at this point in the history
  • Loading branch information
connorhu committed Feb 8, 2024
1 parent ab77924 commit a4b605e
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions src/Query/Mysql/Cast.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Query/Mysql/ConcatWs.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/Query/Mysql/CountIf.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/Query/Mysql/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Query/Mysql/Greatest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Query/Mysql/GroupConcat.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Query/Mysql/Least.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions src/Query/Mysql/MatchAgainst.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions src/Query/Oracle/Listagg.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
}

Expand All @@ -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) . ')';
Expand Down
2 changes: 1 addition & 1 deletion src/Query/Postgresql/Greatest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Query/Postgresql/Least.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/Query/SortableNullsWalker.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Query/Sqlite/ConcatWs.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/Query/Sqlite/Greatest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Query/Sqlite/Least.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a4b605e

Please sign in to comment.