mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-26 08:35:00 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -12,7 +12,6 @@ declare(strict_types=1);
|
||||
namespace Chill\MainBundle\Doctrine\DQL;
|
||||
|
||||
use Doctrine\ORM\Query\AST\Functions\FunctionNode;
|
||||
use Doctrine\ORM\Query\AST\PathExpression;
|
||||
use Doctrine\ORM\Query\Lexer;
|
||||
use Doctrine\ORM\Query\Parser;
|
||||
use Doctrine\ORM\Query\SqlWalker;
|
||||
|
@@ -30,9 +30,9 @@ class Extract extends FunctionNode
|
||||
private string $field;
|
||||
|
||||
private null|\Doctrine\ORM\Query\AST\Node|string $value = null;
|
||||
//private PathExpression $value;
|
||||
//private FunctionNode $value;
|
||||
//private DateDiffFunction $value;
|
||||
// private PathExpression $value;
|
||||
// private FunctionNode $value;
|
||||
// private DateDiffFunction $value;
|
||||
|
||||
public function getSql(SqlWalker $sqlWalker)
|
||||
{
|
||||
@@ -53,7 +53,7 @@ class Extract extends FunctionNode
|
||||
|
||||
$parser->match(Lexer::T_FROM);
|
||||
|
||||
//$this->value = $parser->ScalarExpression();
|
||||
// $this->value = $parser->ScalarExpression();
|
||||
$this->value = $parser->ArithmeticPrimary();
|
||||
|
||||
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
|
||||
|
@@ -33,7 +33,7 @@ class Greatest extends FunctionNode
|
||||
|
||||
public function getSql(SqlWalker $sqlWalker)
|
||||
{
|
||||
return 'GREATEST(' . implode(', ', array_map(static fn (Node $expr) => $expr->dispatch($sqlWalker), $this->exprs)) . ')';
|
||||
return 'GREATEST('.implode(', ', array_map(static fn (Node $expr) => $expr->dispatch($sqlWalker), $this->exprs)).')';
|
||||
}
|
||||
|
||||
public function parse(Parser $parser)
|
||||
|
@@ -32,7 +32,7 @@ class JsonBuildObject extends FunctionNode
|
||||
|
||||
public function getSql(SqlWalker $sqlWalker)
|
||||
{
|
||||
return 'JSONB_BUILD_OBJECT(' . implode(', ', array_map(static fn (Node $expr) => $expr->dispatch($sqlWalker), $this->exprs)) . ')';
|
||||
return 'JSONB_BUILD_OBJECT('.implode(', ', array_map(static fn (Node $expr) => $expr->dispatch($sqlWalker), $this->exprs)).')';
|
||||
}
|
||||
|
||||
public function parse(Parser $parser)
|
||||
|
@@ -33,7 +33,7 @@ class Least extends FunctionNode
|
||||
|
||||
public function getSql(SqlWalker $sqlWalker)
|
||||
{
|
||||
return 'LEAST(' . implode(', ', array_map(static fn (Node $expr) => $expr->dispatch($sqlWalker), $this->exprs)) . ')';
|
||||
return 'LEAST('.implode(', ', array_map(static fn (Node $expr) => $expr->dispatch($sqlWalker), $this->exprs)).')';
|
||||
}
|
||||
|
||||
public function parse(Parser $parser)
|
||||
|
@@ -15,7 +15,6 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode;
|
||||
use Doctrine\ORM\Query\AST\PathExpression;
|
||||
use Doctrine\ORM\Query\Lexer;
|
||||
use Doctrine\ORM\Query\Parser;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* DQL function for OVERLAPS function in postgresql.
|
||||
@@ -76,7 +75,7 @@ class OverlapsI extends FunctionNode
|
||||
$p = match ($position) {
|
||||
'start' => '-infinity',
|
||||
'end' => 'infinity',
|
||||
default => throw new Exception('Unexpected position value.'),
|
||||
default => throw new \Exception('Unexpected position value.'),
|
||||
};
|
||||
|
||||
if ($part instanceof PathExpression) {
|
||||
|
@@ -24,12 +24,12 @@ class Replace extends FunctionNode
|
||||
|
||||
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string
|
||||
{
|
||||
return 'REPLACE(' .
|
||||
$this->string->dispatch($sqlWalker) .
|
||||
', ' .
|
||||
$this->from->dispatch($sqlWalker) .
|
||||
', ' .
|
||||
$this->to->dispatch($sqlWalker) .
|
||||
return 'REPLACE('.
|
||||
$this->string->dispatch($sqlWalker).
|
||||
', '.
|
||||
$this->from->dispatch($sqlWalker).
|
||||
', '.
|
||||
$this->to->dispatch($sqlWalker).
|
||||
')';
|
||||
}
|
||||
|
||||
|
@@ -25,8 +25,8 @@ class STContains extends FunctionNode
|
||||
|
||||
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
|
||||
{
|
||||
return 'ST_CONTAINS(' . $this->firstPart->dispatch($sqlWalker) .
|
||||
', ' . $this->secondPart->dispatch($sqlWalker) . ')';
|
||||
return 'ST_CONTAINS('.$this->firstPart->dispatch($sqlWalker).
|
||||
', '.$this->secondPart->dispatch($sqlWalker).')';
|
||||
}
|
||||
|
||||
public function parse(\Doctrine\ORM\Query\Parser $parser)
|
||||
|
@@ -22,8 +22,8 @@ class Similarity extends FunctionNode
|
||||
|
||||
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
|
||||
{
|
||||
return 'SIMILARITY(' . $this->firstPart->dispatch($sqlWalker) .
|
||||
', ' . $this->secondPart->dispatch($sqlWalker) . ')';
|
||||
return 'SIMILARITY('.$this->firstPart->dispatch($sqlWalker).
|
||||
', '.$this->secondPart->dispatch($sqlWalker).')';
|
||||
}
|
||||
|
||||
public function parse(\Doctrine\ORM\Query\Parser $parser)
|
||||
|
@@ -23,8 +23,8 @@ class StrictWordSimilarityOPS extends \Doctrine\ORM\Query\AST\Functions\Function
|
||||
|
||||
public function getSql(SqlWalker $sqlWalker)
|
||||
{
|
||||
return $this->firstPart->dispatch($sqlWalker) .
|
||||
' <<% ' . $this->secondPart->dispatch($sqlWalker);
|
||||
return $this->firstPart->dispatch($sqlWalker).
|
||||
' <<% '.$this->secondPart->dispatch($sqlWalker);
|
||||
}
|
||||
|
||||
public function parse(Parser $parser)
|
||||
|
@@ -26,7 +26,7 @@ class Unaccent extends FunctionNode
|
||||
|
||||
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
|
||||
{
|
||||
return 'UNACCENT(' . $this->string->dispatch($sqlWalker) . ')';
|
||||
return 'UNACCENT('.$this->string->dispatch($sqlWalker).')';
|
||||
}
|
||||
|
||||
public function parse(\Doctrine\ORM\Query\Parser $parser)
|
||||
|
Reference in New Issue
Block a user