Other files ignored by Codecov
psalm.xml
has changed.
lib/Doctrine/ORM/Query/AST/InExpression.php
was deleted.
UPGRADE.md
has changed.
phpstan-params.neon
has changed.
4 | 4 | ||
5 | 5 | namespace Doctrine\ORM\Query\AST; |
|
6 | 6 | ||
7 | - | class InSubselectExpression extends InExpression |
|
7 | + | use Doctrine\ORM\Query\SqlWalker; |
|
8 | + | ||
9 | + | class InSubselectExpression extends Node |
|
8 | 10 | { |
|
9 | - | /** @var Subselect */ |
|
10 | - | public $subselect; |
|
11 | + | public function __construct( |
|
12 | + | public ArithmeticExpression $expression, |
|
13 | + | public Subselect $subselect, |
|
14 | + | public bool $not = false, |
|
15 | + | ) { |
|
16 | + | } |
|
11 | 17 | ||
12 | - | public function __construct(ArithmeticExpression $expression, Subselect $subselect, bool $not = false) |
|
18 | + | public function dispatch(SqlWalker $walker): string |
|
13 | 19 | { |
|
14 | - | $this->subselect = $subselect; |
|
15 | - | $this->not = $not; |
|
16 | - | ||
17 | - | parent::__construct($expression); |
|
20 | + | return $walker->walkInSubselectExpression($this); |
|
18 | 21 | } |
|
19 | 22 | } |
4 | 4 | ||
5 | 5 | namespace Doctrine\ORM\Query\AST; |
|
6 | 6 | ||
7 | - | use Doctrine\Deprecations\Deprecation; |
|
8 | 7 | use Doctrine\ORM\Query\SqlWalker; |
|
9 | 8 | ||
10 | - | use function func_num_args; |
|
11 | - | ||
12 | 9 | /** |
|
13 | 10 | * InstanceOfExpression ::= IdentificationVariable ["NOT"] "INSTANCE" ["OF"] (InstanceOfParameter | "(" InstanceOfParameter {"," InstanceOfParameter}* ")") |
|
14 | 11 | * InstanceOfParameter ::= AbstractSchemaName | InputParameter |
23 | 20 | */ |
|
24 | 21 | public function __construct( |
|
25 | 22 | public $identificationVariable, |
|
26 | - | public array $value = [], |
|
23 | + | public array $value, |
|
27 | 24 | public bool $not = false, |
|
28 | 25 | ) { |
|
29 | - | if (func_num_args() < 2) { |
|
30 | - | Deprecation::trigger( |
|
31 | - | 'doctrine/orm', |
|
32 | - | 'https://github.com/doctrine/orm/pull/10267', |
|
33 | - | 'Not passing a value for $value to %s() is deprecated.', |
|
34 | - | __METHOD__, |
|
35 | - | ); |
|
36 | - | } |
|
37 | 26 | } |
|
38 | 27 | ||
39 | 28 | public function dispatch(SqlWalker $walker): string |
9 | 9 | use Doctrine\DBAL\LockMode; |
|
10 | 10 | use Doctrine\DBAL\Platforms\AbstractPlatform; |
|
11 | 11 | use Doctrine\DBAL\Types\Type; |
|
12 | - | use Doctrine\Deprecations\Deprecation; |
|
13 | 12 | use Doctrine\ORM\EntityManagerInterface; |
|
14 | 13 | use Doctrine\ORM\Mapping\ClassMetadata; |
|
15 | 14 | use Doctrine\ORM\Mapping\QuoteStrategy; |
1944 | 1943 | return $expression->dispatch($this) . $comparison; |
|
1945 | 1944 | } |
|
1946 | 1945 | ||
1947 | - | /** |
|
1948 | - | * Walks down an InExpression AST node, thereby generating the appropriate SQL. |
|
1949 | - | * |
|
1950 | - | * @deprecated Use {@see walkInListExpression()} or {@see walkInSubselectExpression()} instead. |
|
1951 | - | */ |
|
1952 | - | public function walkInExpression(AST\InExpression $inExpr): string |
|
1953 | - | { |
|
1954 | - | Deprecation::triggerIfCalledFromOutside( |
|
1955 | - | 'doctrine/orm', |
|
1956 | - | '%s() is deprecated, call walkInListExpression() or walkInSubselectExpression() instead.', |
|
1957 | - | __METHOD__, |
|
1958 | - | ); |
|
1959 | - | ||
1960 | - | if ($inExpr instanceof AST\InListExpression) { |
|
1961 | - | return $this->walkInListExpression($inExpr); |
|
1962 | - | } |
|
1963 | - | ||
1964 | - | if ($inExpr instanceof AST\InSubselectExpression) { |
|
1965 | - | return $this->walkInSubselectExpression($inExpr); |
|
1966 | - | } |
|
1967 | - | ||
1968 | - | $sql = $this->walkArithmeticExpression($inExpr->expression) . ($inExpr->not ? ' NOT' : '') . ' IN ('; |
|
1969 | - | ||
1970 | - | $sql .= $inExpr->subselect |
|
1971 | - | ? $this->walkSubselect($inExpr->subselect) |
|
1972 | - | : implode(', ', array_map([$this, 'walkInParameter'], $inExpr->literals)); |
|
1973 | - | ||
1974 | - | $sql .= ')'; |
|
1975 | - | ||
1976 | - | return $sql; |
|
1977 | - | } |
|
1978 | - | ||
1979 | 1946 | /** |
|
1980 | 1947 | * Walks down an InExpression AST node, thereby generating the appropriate SQL. |
|
1981 | 1948 | */ |
4 | 4 | ||
5 | 5 | namespace Doctrine\ORM\Query\AST; |
|
6 | 6 | ||
7 | - | class InListExpression extends InExpression |
|
7 | + | use Doctrine\ORM\Query\SqlWalker; |
|
8 | + | ||
9 | + | class InListExpression extends Node |
|
8 | 10 | { |
|
9 | 11 | /** @param non-empty-list<mixed> $literals */ |
|
10 | - | public function __construct(ArithmeticExpression $expression, public array $literals, bool $not = false) |
|
11 | - | { |
|
12 | - | $this->not = $not; |
|
12 | + | public function __construct( |
|
13 | + | public ArithmeticExpression $expression, |
|
14 | + | public array $literals, |
|
15 | + | public bool $not = false, |
|
16 | + | ) { |
|
17 | + | } |
|
13 | 18 | ||
14 | - | parent::__construct($expression); |
|
19 | + | public function dispatch(SqlWalker $walker): string |
|
20 | + | { |
|
21 | + | return $walker->walkInListExpression($this); |
|
15 | 22 | } |
|
16 | 23 | } |
Files | Coverage |
---|---|
lib/Doctrine/ORM | 89.63% |
Project Totals (331 files) | 89.63% |