From 27d83317fac7edd5a95099979a9618ddf9b045fa Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Fri, 24 Feb 2023 18:12:22 +0100 Subject: [PATCH] Mark SqlWalker methods as not deprecated phpstan treats implementations of deprecated methods of an interface as being deprecated themselves by default. However, SqlWalker does not intend to deprecate all those methods that are deprecated in TreeWalker, as they are moved down. Marking them as not deprecated will avoid reporting usages of deprecated APIs when implementing custom DQL functions for instance. --- lib/Doctrine/ORM/Query/SqlWalker.php | 112 +++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) diff --git a/lib/Doctrine/ORM/Query/SqlWalker.php b/lib/Doctrine/ORM/Query/SqlWalker.php index 160e4cdecf0..dbac9dd1c69 100644 --- a/lib/Doctrine/ORM/Query/SqlWalker.php +++ b/lib/Doctrine/ORM/Query/SqlWalker.php @@ -254,6 +254,8 @@ public function getQueryComponents() /** * Sets or overrides a query component for a given dql alias. * + * @not-deprecated + * * @param string $dqlAlias The DQL alias. * @psalm-param QueryComponent $queryComponent * @@ -273,6 +275,8 @@ public function setQueryComponent($dqlAlias, array $queryComponent) /** * Gets an executor that can be used to execute the result of this walker. * + * @not-deprecated + * * @param AST\DeleteStatement|AST\UpdateStatement|AST\SelectStatement $AST * * @return Exec\AbstractSqlExecutor @@ -625,6 +629,8 @@ public function walkDeleteStatement(AST\DeleteStatement $AST) * Walks down an IdentificationVariable AST node, thereby generating the appropriate SQL. * This one differs of ->walkIdentificationVariable() because it generates the entity identifiers. * + * @not-deprecated + * * @param string $identVariable * * @return string @@ -645,6 +651,8 @@ public function walkEntityIdentificationVariable($identVariable) /** * Walks down an IdentificationVariable (no AST node associated), thereby generating the SQL. * + * @not-deprecated + * * @param string $identificationVariable * @param string $fieldName * @@ -667,6 +675,8 @@ public function walkIdentificationVariable($identificationVariable, $fieldName = /** * Walks down a PathExpression AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\PathExpression $pathExpr * * @return string @@ -728,6 +738,8 @@ public function walkPathExpression($pathExpr) /** * Walks down a SelectClause AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\SelectClause $selectClause * * @return string @@ -851,6 +863,8 @@ public function walkSelectClause($selectClause) /** * Walks down a FromClause AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\FromClause $fromClause * * @return string @@ -870,6 +884,8 @@ public function walkFromClause($fromClause) /** * Walks down a IdentificationVariableDeclaration AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\IdentificationVariableDeclaration $identificationVariableDecl * * @return string @@ -892,6 +908,8 @@ public function walkIdentificationVariableDeclaration($identificationVariableDec /** * Walks down a IndexBy AST node. * + * @not-deprecated + * * @param AST\IndexBy $indexBy * * @return void @@ -945,6 +963,8 @@ public function walkIndexBy($indexBy) /** * Walks down a RangeVariableDeclaration AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\RangeVariableDeclaration $rangeVariableDeclaration * * @return string @@ -990,6 +1010,8 @@ private function generateRangeVariableDeclarationSQL( /** * Walks down a JoinAssociationDeclaration AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\JoinAssociationDeclaration $joinAssociationDeclaration * @param int $joinType * @param AST\ConditionalExpression $condExpr @@ -1159,6 +1181,8 @@ public function walkJoinAssociationDeclaration($joinAssociationDeclaration, $joi /** * Walks down a FunctionNode AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\Functions\FunctionNode $function * * @return string @@ -1171,6 +1195,8 @@ public function walkFunction($function) /** * Walks down an OrderByClause AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\OrderByClause $orderByClause * * @return string @@ -1190,6 +1216,8 @@ public function walkOrderByClause($orderByClause) /** * Walks down an OrderByItem AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\OrderByItem $orderByItem * * @return string @@ -1214,6 +1242,8 @@ public function walkOrderByItem($orderByItem) /** * Walks down a HavingClause AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\HavingClause $havingClause * * @return string The SQL. @@ -1226,6 +1256,8 @@ public function walkHavingClause($havingClause) /** * Walks down a Join AST node and creates the corresponding SQL. * + * @not-deprecated + * * @param AST\Join $join * * @return string @@ -1288,6 +1320,8 @@ public function walkJoin($join) /** * Walks down a CoalesceExpression AST node and generates the corresponding SQL. * + * @not-deprecated + * * @param AST\CoalesceExpression $coalesceExpression * * @return string The SQL. @@ -1308,6 +1342,8 @@ public function walkCoalesceExpression($coalesceExpression) /** * Walks down a NullIfExpression AST node and generates the corresponding SQL. * + * @not-deprecated + * * @param AST\NullIfExpression $nullIfExpression * * @return string The SQL. @@ -1328,6 +1364,8 @@ public function walkNullIfExpression($nullIfExpression) /** * Walks down a GeneralCaseExpression AST node and generates the corresponding SQL. * + * @not-deprecated + * * @return string The SQL. */ public function walkGeneralCaseExpression(AST\GeneralCaseExpression $generalCaseExpression) @@ -1347,6 +1385,8 @@ public function walkGeneralCaseExpression(AST\GeneralCaseExpression $generalCase /** * Walks down a SimpleCaseExpression AST node and generates the corresponding SQL. * + * @not-deprecated + * * @param AST\SimpleCaseExpression $simpleCaseExpression * * @return string The SQL. @@ -1368,6 +1408,8 @@ public function walkSimpleCaseExpression($simpleCaseExpression) /** * Walks down a SelectExpression AST node and generates the corresponding SQL. * + * @not-deprecated + * * @param AST\SelectExpression $selectExpression * * @return string @@ -1572,6 +1614,8 @@ public function walkSelectExpression($selectExpression) /** * Walks down a QuantifiedExpression AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\QuantifiedExpression $qExpr * * @return string @@ -1584,6 +1628,8 @@ public function walkQuantifiedExpression($qExpr) /** * Walks down a Subselect AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\Subselect $subselect * * @return string @@ -1613,6 +1659,8 @@ public function walkSubselect($subselect) /** * Walks down a SubselectFromClause AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\SubselectFromClause $subselectFromClause * * @return string @@ -1632,6 +1680,8 @@ public function walkSubselectFromClause($subselectFromClause) /** * Walks down a SimpleSelectClause AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\SimpleSelectClause $simpleSelectClause * * @return string @@ -1730,6 +1780,8 @@ public function walkNewObject($newObjectExpression, $newObjectResultAlias = null /** * Walks down a SimpleSelectExpression AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\SimpleSelectExpression $simpleSelectExpression * * @return string @@ -1785,6 +1837,8 @@ public function walkSimpleSelectExpression($simpleSelectExpression) /** * Walks down an AggregateExpression AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\AggregateExpression $aggExpression * * @return string @@ -1798,6 +1852,8 @@ public function walkAggregateExpression($aggExpression) /** * Walks down a GroupByClause AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\GroupByClause $groupByClause * * @return string @@ -1816,6 +1872,8 @@ public function walkGroupByClause($groupByClause) /** * Walks down a GroupByItem AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\PathExpression|string $groupByItem * * @return string @@ -1867,6 +1925,8 @@ public function walkGroupByItem($groupByItem) /** * Walks down a DeleteClause AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @return string */ public function walkDeleteClause(AST\DeleteClause $deleteClause) @@ -1884,6 +1944,8 @@ public function walkDeleteClause(AST\DeleteClause $deleteClause) /** * Walks down an UpdateClause AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\UpdateClause $updateClause * * @return string @@ -1903,6 +1965,8 @@ public function walkUpdateClause($updateClause) /** * Walks down an UpdateItem AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\UpdateItem $updateItem * * @return string @@ -1938,6 +2002,8 @@ public function walkUpdateItem($updateItem) * Walks down a WhereClause AST node, thereby generating the appropriate SQL. * WhereClause or not, the appropriate discriminator sql is added. * + * @not-deprecated + * * @param AST\WhereClause $whereClause * * @return string @@ -1982,6 +2048,8 @@ public function walkWhereClause($whereClause) /** * Walk down a ConditionalExpression AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\ConditionalExpression $condExpr * * @return string @@ -2000,6 +2068,8 @@ public function walkConditionalExpression($condExpr) /** * Walks down a ConditionalTerm AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\ConditionalTerm $condTerm * * @return string @@ -2018,6 +2088,8 @@ public function walkConditionalTerm($condTerm) /** * Walks down a ConditionalFactor AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\ConditionalFactor $factor * * @return string The SQL. @@ -2034,6 +2106,8 @@ public function walkConditionalFactor($factor) /** * Walks down a ConditionalPrimary AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\ConditionalPrimary $primary * * @return string @@ -2054,6 +2128,8 @@ public function walkConditionalPrimary($primary) /** * Walks down an ExistsExpression AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\ExistsExpression $existsExpr * * @return string @@ -2070,6 +2146,8 @@ public function walkExistsExpression($existsExpr) /** * Walks down a CollectionMemberExpression AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\CollectionMemberExpression $collMemberExpr * * @return string @@ -2171,6 +2249,8 @@ public function walkCollectionMemberExpression($collMemberExpr) /** * Walks down an EmptyCollectionComparisonExpression AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\EmptyCollectionComparisonExpression $emptyCollCompExpr * * @return string @@ -2186,6 +2266,8 @@ public function walkEmptyCollectionComparisonExpression($emptyCollCompExpr) /** * Walks down a NullComparisonExpression AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\NullComparisonExpression $nullCompExpr * * @return string @@ -2270,6 +2352,8 @@ public function walkInSubselectExpression(AST\InSubselectExpression $inExpr): st /** * Walks down an InstanceOfExpression AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\InstanceOfExpression $instanceOfExpr * * @return string @@ -2298,6 +2382,8 @@ public function walkInstanceOfExpression($instanceOfExpr) } /** + * @not-deprecated + * * @param mixed $inParam * * @return string @@ -2312,6 +2398,8 @@ public function walkInParameter($inParam) /** * Walks down a literal that represents an AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\Literal $literal * * @return string @@ -2336,6 +2424,8 @@ public function walkLiteral($literal) /** * Walks down a BetweenExpression AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\BetweenExpression $betweenExpr * * @return string @@ -2357,6 +2447,8 @@ public function walkBetweenExpression($betweenExpr) /** * Walks down a LikeExpression AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\LikeExpression $likeExpr * * @return string @@ -2396,6 +2488,8 @@ public function walkLikeExpression($likeExpr) /** * Walks down a StateFieldPathExpression AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\PathExpression $stateFieldPathExpression * * @return string @@ -2408,6 +2502,8 @@ public function walkStateFieldPathExpression($stateFieldPathExpression) /** * Walks down a ComparisonExpression AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\ComparisonExpression $compExpr * * @return string @@ -2434,6 +2530,8 @@ public function walkComparisonExpression($compExpr) /** * Walks down an InputParameter AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\InputParameter $inputParam * * @return string @@ -2457,6 +2555,8 @@ public function walkInputParameter($inputParam) /** * Walks down an ArithmeticExpression AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\ArithmeticExpression $arithmeticExpr * * @return string @@ -2471,6 +2571,8 @@ public function walkArithmeticExpression($arithmeticExpr) /** * Walks down an SimpleArithmeticExpression AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param AST\SimpleArithmeticExpression $simpleArithmeticExpr * * @return string @@ -2487,6 +2589,8 @@ public function walkSimpleArithmeticExpression($simpleArithmeticExpr) /** * Walks down an ArithmeticTerm AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param mixed $term * * @return string @@ -2511,6 +2615,8 @@ public function walkArithmeticTerm($term) /** * Walks down an ArithmeticFactor that represents an AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param mixed $factor * * @return string @@ -2537,6 +2643,8 @@ public function walkArithmeticFactor($factor) /** * Walks down an ArithmeticPrimary that represents an AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param mixed $primary * * @return string The SQL. @@ -2557,6 +2665,8 @@ public function walkArithmeticPrimary($primary) /** * Walks down a StringPrimary that represents an AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param mixed $stringPrimary * * @return string @@ -2571,6 +2681,8 @@ public function walkStringPrimary($stringPrimary) /** * Walks down a ResultVariable that represents an AST node, thereby generating the appropriate SQL. * + * @not-deprecated + * * @param string $resultVariable * * @return string