vendor/doctrine/orm/lib/Doctrine/ORM/Query/TreeWalkerChain.php line 94

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Doctrine\ORM\Query;
  4. use Doctrine\Deprecations\Deprecation;
  5. use Doctrine\ORM\AbstractQuery;
  6. use Generator;
  7. use function array_diff;
  8. use function array_keys;
  9. /**
  10.  * Represents a chain of tree walkers that modify an AST and finally emit output.
  11.  * Only the last walker in the chain can emit output. Any previous walkers can modify
  12.  * the AST to influence the final output produced by the last walker.
  13.  *
  14.  * @psalm-import-type QueryComponent from Parser
  15.  */
  16. class TreeWalkerChain implements TreeWalker
  17. {
  18.     /**
  19.      * The tree walkers.
  20.      *
  21.      * @var string[]
  22.      * @psalm-var list<class-string<TreeWalker>>
  23.      */
  24.     private $walkers = [];
  25.     /** @var AbstractQuery */
  26.     private $query;
  27.     /** @var ParserResult */
  28.     private $parserResult;
  29.     /**
  30.      * The query components of the original query (the "symbol table") that was produced by the Parser.
  31.      *
  32.      * @var array<string, array<string, mixed>>
  33.      * @psalm-var array<string, QueryComponent>
  34.      */
  35.     private $queryComponents;
  36.     /**
  37.      * Returns the internal queryComponents array.
  38.      *
  39.      * {@inheritDoc}
  40.      */
  41.     public function getQueryComponents()
  42.     {
  43.         return $this->queryComponents;
  44.     }
  45.     /**
  46.      * {@inheritdoc}
  47.      *
  48.      * @return void
  49.      */
  50.     public function setQueryComponent($dqlAlias, array $queryComponent)
  51.     {
  52.         $requiredKeys = ['metadata''parent''relation''map''nestingLevel''token'];
  53.         if (array_diff($requiredKeysarray_keys($queryComponent))) {
  54.             throw QueryException::invalidQueryComponent($dqlAlias);
  55.         }
  56.         $this->queryComponents[$dqlAlias] = $queryComponent;
  57.     }
  58.     /**
  59.      * {@inheritdoc}
  60.      */
  61.     public function __construct($query$parserResult, array $queryComponents)
  62.     {
  63.         $this->query           $query;
  64.         $this->parserResult    $parserResult;
  65.         $this->queryComponents $queryComponents;
  66.     }
  67.     /**
  68.      * Adds a tree walker to the chain.
  69.      *
  70.      * @param string $walkerClass The class of the walker to instantiate.
  71.      * @psalm-param class-string<TreeWalker> $walkerClass
  72.      *
  73.      * @return void
  74.      */
  75.     public function addTreeWalker($walkerClass)
  76.     {
  77.         $this->walkers[] = $walkerClass;
  78.     }
  79.     public function walkSelectStatement(AST\SelectStatement $AST)
  80.     {
  81.         foreach ($this->getWalkers() as $walker) {
  82.             $walker->walkSelectStatement($AST);
  83.             $this->queryComponents $walker->getQueryComponents();
  84.         }
  85.     }
  86.     /**
  87.      * {@inheritdoc}
  88.      *
  89.      * @deprecated This method will be removed in 3.0.
  90.      */
  91.     public function walkSelectClause($selectClause)
  92.     {
  93.         Deprecation::trigger(
  94.             'doctrine/orm',
  95.             'https://github.com/doctrine/orm/pull/9551',
  96.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  97.             __METHOD__
  98.         );
  99.         foreach ($this->getWalkers() as $walker) {
  100.             $walker->walkSelectClause($selectClause);
  101.         }
  102.     }
  103.     /**
  104.      * {@inheritdoc}
  105.      *
  106.      * @deprecated This method will be removed in 3.0.
  107.      */
  108.     public function walkFromClause($fromClause)
  109.     {
  110.         Deprecation::trigger(
  111.             'doctrine/orm',
  112.             'https://github.com/doctrine/orm/pull/9551',
  113.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  114.             __METHOD__
  115.         );
  116.         foreach ($this->getWalkers() as $walker) {
  117.             $walker->walkFromClause($fromClause);
  118.         }
  119.     }
  120.     /**
  121.      * {@inheritdoc}
  122.      *
  123.      * @deprecated This method will be removed in 3.0.
  124.      */
  125.     public function walkFunction($function)
  126.     {
  127.         Deprecation::trigger(
  128.             'doctrine/orm',
  129.             'https://github.com/doctrine/orm/pull/9551',
  130.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  131.             __METHOD__
  132.         );
  133.         foreach ($this->getWalkers() as $walker) {
  134.             $walker->walkFunction($function);
  135.         }
  136.     }
  137.     /**
  138.      * {@inheritdoc}
  139.      *
  140.      * @deprecated This method will be removed in 3.0.
  141.      */
  142.     public function walkOrderByClause($orderByClause)
  143.     {
  144.         Deprecation::trigger(
  145.             'doctrine/orm',
  146.             'https://github.com/doctrine/orm/pull/9551',
  147.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  148.             __METHOD__
  149.         );
  150.         foreach ($this->getWalkers() as $walker) {
  151.             $walker->walkOrderByClause($orderByClause);
  152.         }
  153.     }
  154.     /**
  155.      * {@inheritdoc}
  156.      *
  157.      * @deprecated This method will be removed in 3.0.
  158.      */
  159.     public function walkOrderByItem($orderByItem)
  160.     {
  161.         Deprecation::trigger(
  162.             'doctrine/orm',
  163.             'https://github.com/doctrine/orm/pull/9551',
  164.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  165.             __METHOD__
  166.         );
  167.         foreach ($this->getWalkers() as $walker) {
  168.             $walker->walkOrderByItem($orderByItem);
  169.         }
  170.     }
  171.     /**
  172.      * {@inheritdoc}
  173.      *
  174.      * @deprecated This method will be removed in 3.0.
  175.      */
  176.     public function walkHavingClause($havingClause)
  177.     {
  178.         Deprecation::trigger(
  179.             'doctrine/orm',
  180.             'https://github.com/doctrine/orm/pull/9551',
  181.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  182.             __METHOD__
  183.         );
  184.         foreach ($this->getWalkers() as $walker) {
  185.             $walker->walkHavingClause($havingClause);
  186.         }
  187.     }
  188.     /**
  189.      * {@inheritdoc}
  190.      *
  191.      * @deprecated This method will be removed in 3.0.
  192.      */
  193.     public function walkJoin($join)
  194.     {
  195.         Deprecation::trigger(
  196.             'doctrine/orm',
  197.             'https://github.com/doctrine/orm/pull/9551',
  198.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  199.             __METHOD__
  200.         );
  201.         foreach ($this->getWalkers() as $walker) {
  202.             $walker->walkJoin($join);
  203.         }
  204.     }
  205.     /**
  206.      * {@inheritdoc}
  207.      *
  208.      * @deprecated This method will be removed in 3.0.
  209.      */
  210.     public function walkSelectExpression($selectExpression)
  211.     {
  212.         Deprecation::trigger(
  213.             'doctrine/orm',
  214.             'https://github.com/doctrine/orm/pull/9551',
  215.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  216.             __METHOD__
  217.         );
  218.         foreach ($this->getWalkers() as $walker) {
  219.             $walker->walkSelectExpression($selectExpression);
  220.         }
  221.     }
  222.     /**
  223.      * {@inheritdoc}
  224.      *
  225.      * @deprecated This method will be removed in 3.0.
  226.      */
  227.     public function walkQuantifiedExpression($qExpr)
  228.     {
  229.         Deprecation::trigger(
  230.             'doctrine/orm',
  231.             'https://github.com/doctrine/orm/pull/9551',
  232.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  233.             __METHOD__
  234.         );
  235.         foreach ($this->getWalkers() as $walker) {
  236.             $walker->walkQuantifiedExpression($qExpr);
  237.         }
  238.     }
  239.     /**
  240.      * {@inheritdoc}
  241.      *
  242.      * @deprecated This method will be removed in 3.0.
  243.      */
  244.     public function walkSubselect($subselect)
  245.     {
  246.         Deprecation::trigger(
  247.             'doctrine/orm',
  248.             'https://github.com/doctrine/orm/pull/9551',
  249.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  250.             __METHOD__
  251.         );
  252.         foreach ($this->getWalkers() as $walker) {
  253.             $walker->walkSubselect($subselect);
  254.         }
  255.     }
  256.     /**
  257.      * {@inheritdoc}
  258.      *
  259.      * @deprecated This method will be removed in 3.0.
  260.      */
  261.     public function walkSubselectFromClause($subselectFromClause)
  262.     {
  263.         Deprecation::trigger(
  264.             'doctrine/orm',
  265.             'https://github.com/doctrine/orm/pull/9551',
  266.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  267.             __METHOD__
  268.         );
  269.         foreach ($this->getWalkers() as $walker) {
  270.             $walker->walkSubselectFromClause($subselectFromClause);
  271.         }
  272.     }
  273.     /**
  274.      * {@inheritdoc}
  275.      *
  276.      * @deprecated This method will be removed in 3.0.
  277.      */
  278.     public function walkSimpleSelectClause($simpleSelectClause)
  279.     {
  280.         Deprecation::trigger(
  281.             'doctrine/orm',
  282.             'https://github.com/doctrine/orm/pull/9551',
  283.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  284.             __METHOD__
  285.         );
  286.         foreach ($this->getWalkers() as $walker) {
  287.             $walker->walkSimpleSelectClause($simpleSelectClause);
  288.         }
  289.     }
  290.     /**
  291.      * {@inheritdoc}
  292.      *
  293.      * @deprecated This method will be removed in 3.0.
  294.      */
  295.     public function walkSimpleSelectExpression($simpleSelectExpression)
  296.     {
  297.         Deprecation::trigger(
  298.             'doctrine/orm',
  299.             'https://github.com/doctrine/orm/pull/9551',
  300.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  301.             __METHOD__
  302.         );
  303.         foreach ($this->getWalkers() as $walker) {
  304.             $walker->walkSimpleSelectExpression($simpleSelectExpression);
  305.         }
  306.     }
  307.     /**
  308.      * {@inheritdoc}
  309.      *
  310.      * @deprecated This method will be removed in 3.0.
  311.      */
  312.     public function walkAggregateExpression($aggExpression)
  313.     {
  314.         Deprecation::trigger(
  315.             'doctrine/orm',
  316.             'https://github.com/doctrine/orm/pull/9551',
  317.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  318.             __METHOD__
  319.         );
  320.         foreach ($this->getWalkers() as $walker) {
  321.             $walker->walkAggregateExpression($aggExpression);
  322.         }
  323.     }
  324.     /**
  325.      * {@inheritdoc}
  326.      *
  327.      * @deprecated This method will be removed in 3.0.
  328.      */
  329.     public function walkGroupByClause($groupByClause)
  330.     {
  331.         Deprecation::trigger(
  332.             'doctrine/orm',
  333.             'https://github.com/doctrine/orm/pull/9551',
  334.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  335.             __METHOD__
  336.         );
  337.         foreach ($this->getWalkers() as $walker) {
  338.             $walker->walkGroupByClause($groupByClause);
  339.         }
  340.     }
  341.     /**
  342.      * {@inheritdoc}
  343.      *
  344.      * @deprecated This method will be removed in 3.0.
  345.      */
  346.     public function walkGroupByItem($groupByItem)
  347.     {
  348.         Deprecation::trigger(
  349.             'doctrine/orm',
  350.             'https://github.com/doctrine/orm/pull/9551',
  351.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  352.             __METHOD__
  353.         );
  354.         foreach ($this->getWalkers() as $walker) {
  355.             $walker->walkGroupByItem($groupByItem);
  356.         }
  357.     }
  358.     public function walkUpdateStatement(AST\UpdateStatement $AST)
  359.     {
  360.         foreach ($this->getWalkers() as $walker) {
  361.             $walker->walkUpdateStatement($AST);
  362.         }
  363.     }
  364.     public function walkDeleteStatement(AST\DeleteStatement $AST)
  365.     {
  366.         foreach ($this->getWalkers() as $walker) {
  367.             $walker->walkDeleteStatement($AST);
  368.         }
  369.     }
  370.     /**
  371.      * {@inheritdoc}
  372.      *
  373.      * @deprecated This method will be removed in 3.0.
  374.      */
  375.     public function walkDeleteClause(AST\DeleteClause $deleteClause)
  376.     {
  377.         Deprecation::trigger(
  378.             'doctrine/orm',
  379.             'https://github.com/doctrine/orm/pull/9551',
  380.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  381.             __METHOD__
  382.         );
  383.         foreach ($this->getWalkers() as $walker) {
  384.             $walker->walkDeleteClause($deleteClause);
  385.         }
  386.     }
  387.     /**
  388.      * {@inheritdoc}
  389.      *
  390.      * @deprecated This method will be removed in 3.0.
  391.      */
  392.     public function walkUpdateClause($updateClause)
  393.     {
  394.         Deprecation::trigger(
  395.             'doctrine/orm',
  396.             'https://github.com/doctrine/orm/pull/9551',
  397.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  398.             __METHOD__
  399.         );
  400.         foreach ($this->getWalkers() as $walker) {
  401.             $walker->walkUpdateClause($updateClause);
  402.         }
  403.     }
  404.     /**
  405.      * {@inheritdoc}
  406.      *
  407.      * @deprecated This method will be removed in 3.0.
  408.      */
  409.     public function walkUpdateItem($updateItem)
  410.     {
  411.         Deprecation::trigger(
  412.             'doctrine/orm',
  413.             'https://github.com/doctrine/orm/pull/9551',
  414.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  415.             __METHOD__
  416.         );
  417.         foreach ($this->getWalkers() as $walker) {
  418.             $walker->walkUpdateItem($updateItem);
  419.         }
  420.     }
  421.     /**
  422.      * {@inheritdoc}
  423.      *
  424.      * @deprecated This method will be removed in 3.0.
  425.      */
  426.     public function walkWhereClause($whereClause)
  427.     {
  428.         Deprecation::trigger(
  429.             'doctrine/orm',
  430.             'https://github.com/doctrine/orm/pull/9551',
  431.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  432.             __METHOD__
  433.         );
  434.         foreach ($this->getWalkers() as $walker) {
  435.             $walker->walkWhereClause($whereClause);
  436.         }
  437.     }
  438.     /**
  439.      * {@inheritdoc}
  440.      *
  441.      * @deprecated This method will be removed in 3.0.
  442.      */
  443.     public function walkConditionalExpression($condExpr)
  444.     {
  445.         Deprecation::trigger(
  446.             'doctrine/orm',
  447.             'https://github.com/doctrine/orm/pull/9551',
  448.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  449.             __METHOD__
  450.         );
  451.         foreach ($this->getWalkers() as $walker) {
  452.             $walker->walkConditionalExpression($condExpr);
  453.         }
  454.     }
  455.     /**
  456.      * {@inheritdoc}
  457.      *
  458.      * @deprecated This method will be removed in 3.0.
  459.      */
  460.     public function walkConditionalTerm($condTerm)
  461.     {
  462.         Deprecation::trigger(
  463.             'doctrine/orm',
  464.             'https://github.com/doctrine/orm/pull/9551',
  465.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  466.             __METHOD__
  467.         );
  468.         foreach ($this->getWalkers() as $walker) {
  469.             $walker->walkConditionalTerm($condTerm);
  470.         }
  471.     }
  472.     /**
  473.      * {@inheritdoc}
  474.      *
  475.      * @deprecated This method will be removed in 3.0.
  476.      */
  477.     public function walkConditionalFactor($factor)
  478.     {
  479.         Deprecation::trigger(
  480.             'doctrine/orm',
  481.             'https://github.com/doctrine/orm/pull/9551',
  482.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  483.             __METHOD__
  484.         );
  485.         foreach ($this->getWalkers() as $walker) {
  486.             $walker->walkConditionalFactor($factor);
  487.         }
  488.     }
  489.     /**
  490.      * {@inheritdoc}
  491.      *
  492.      * @deprecated This method will be removed in 3.0.
  493.      */
  494.     public function walkConditionalPrimary($condPrimary)
  495.     {
  496.         Deprecation::trigger(
  497.             'doctrine/orm',
  498.             'https://github.com/doctrine/orm/pull/9551',
  499.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  500.             __METHOD__
  501.         );
  502.         foreach ($this->getWalkers() as $walker) {
  503.             $walker->walkConditionalPrimary($condPrimary);
  504.         }
  505.     }
  506.     /**
  507.      * {@inheritdoc}
  508.      *
  509.      * @deprecated This method will be removed in 3.0.
  510.      */
  511.     public function walkExistsExpression($existsExpr)
  512.     {
  513.         Deprecation::trigger(
  514.             'doctrine/orm',
  515.             'https://github.com/doctrine/orm/pull/9551',
  516.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  517.             __METHOD__
  518.         );
  519.         foreach ($this->getWalkers() as $walker) {
  520.             $walker->walkExistsExpression($existsExpr);
  521.         }
  522.     }
  523.     /**
  524.      * {@inheritdoc}
  525.      *
  526.      * @deprecated This method will be removed in 3.0.
  527.      */
  528.     public function walkCollectionMemberExpression($collMemberExpr)
  529.     {
  530.         Deprecation::trigger(
  531.             'doctrine/orm',
  532.             'https://github.com/doctrine/orm/pull/9551',
  533.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  534.             __METHOD__
  535.         );
  536.         foreach ($this->getWalkers() as $walker) {
  537.             $walker->walkCollectionMemberExpression($collMemberExpr);
  538.         }
  539.     }
  540.     /**
  541.      * {@inheritdoc}
  542.      *
  543.      * @deprecated This method will be removed in 3.0.
  544.      */
  545.     public function walkEmptyCollectionComparisonExpression($emptyCollCompExpr)
  546.     {
  547.         Deprecation::trigger(
  548.             'doctrine/orm',
  549.             'https://github.com/doctrine/orm/pull/9551',
  550.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  551.             __METHOD__
  552.         );
  553.         foreach ($this->getWalkers() as $walker) {
  554.             $walker->walkEmptyCollectionComparisonExpression($emptyCollCompExpr);
  555.         }
  556.     }
  557.     /**
  558.      * {@inheritdoc}
  559.      *
  560.      * @deprecated This method will be removed in 3.0.
  561.      */
  562.     public function walkNullComparisonExpression($nullCompExpr)
  563.     {
  564.         Deprecation::trigger(
  565.             'doctrine/orm',
  566.             'https://github.com/doctrine/orm/pull/9551',
  567.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  568.             __METHOD__
  569.         );
  570.         foreach ($this->getWalkers() as $walker) {
  571.             $walker->walkNullComparisonExpression($nullCompExpr);
  572.         }
  573.     }
  574.     /**
  575.      * {@inheritdoc}
  576.      *
  577.      * @deprecated This method will be removed in 3.0.
  578.      */
  579.     public function walkInExpression($inExpr)
  580.     {
  581.         Deprecation::trigger(
  582.             'doctrine/orm',
  583.             'https://github.com/doctrine/orm/pull/9551',
  584.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  585.             __METHOD__
  586.         );
  587.         foreach ($this->getWalkers() as $walker) {
  588.             $walker->walkInExpression($inExpr);
  589.         }
  590.     }
  591.     /**
  592.      * {@inheritdoc}
  593.      *
  594.      * @deprecated This method will be removed in 3.0.
  595.      */
  596.     public function walkInstanceOfExpression($instanceOfExpr)
  597.     {
  598.         Deprecation::trigger(
  599.             'doctrine/orm',
  600.             'https://github.com/doctrine/orm/pull/9551',
  601.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  602.             __METHOD__
  603.         );
  604.         foreach ($this->getWalkers() as $walker) {
  605.             $walker->walkInstanceOfExpression($instanceOfExpr);
  606.         }
  607.     }
  608.     /**
  609.      * {@inheritdoc}
  610.      *
  611.      * @deprecated This method will be removed in 3.0.
  612.      */
  613.     public function walkLiteral($literal)
  614.     {
  615.         Deprecation::trigger(
  616.             'doctrine/orm',
  617.             'https://github.com/doctrine/orm/pull/9551',
  618.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  619.             __METHOD__
  620.         );
  621.         foreach ($this->getWalkers() as $walker) {
  622.             $walker->walkLiteral($literal);
  623.         }
  624.     }
  625.     /**
  626.      * {@inheritdoc}
  627.      *
  628.      * @deprecated This method will be removed in 3.0.
  629.      */
  630.     public function walkBetweenExpression($betweenExpr)
  631.     {
  632.         Deprecation::trigger(
  633.             'doctrine/orm',
  634.             'https://github.com/doctrine/orm/pull/9551',
  635.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  636.             __METHOD__
  637.         );
  638.         foreach ($this->getWalkers() as $walker) {
  639.             $walker->walkBetweenExpression($betweenExpr);
  640.         }
  641.     }
  642.     /**
  643.      * {@inheritdoc}
  644.      *
  645.      * @deprecated This method will be removed in 3.0.
  646.      */
  647.     public function walkLikeExpression($likeExpr)
  648.     {
  649.         Deprecation::trigger(
  650.             'doctrine/orm',
  651.             'https://github.com/doctrine/orm/pull/9551',
  652.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  653.             __METHOD__
  654.         );
  655.         foreach ($this->getWalkers() as $walker) {
  656.             $walker->walkLikeExpression($likeExpr);
  657.         }
  658.     }
  659.     /**
  660.      * {@inheritdoc}
  661.      *
  662.      * @deprecated This method will be removed in 3.0.
  663.      */
  664.     public function walkStateFieldPathExpression($stateFieldPathExpression)
  665.     {
  666.         Deprecation::trigger(
  667.             'doctrine/orm',
  668.             'https://github.com/doctrine/orm/pull/9551',
  669.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  670.             __METHOD__
  671.         );
  672.         foreach ($this->getWalkers() as $walker) {
  673.             $walker->walkStateFieldPathExpression($stateFieldPathExpression);
  674.         }
  675.     }
  676.     /**
  677.      * {@inheritdoc}
  678.      *
  679.      * @deprecated This method will be removed in 3.0.
  680.      */
  681.     public function walkComparisonExpression($compExpr)
  682.     {
  683.         Deprecation::trigger(
  684.             'doctrine/orm',
  685.             'https://github.com/doctrine/orm/pull/9551',
  686.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  687.             __METHOD__
  688.         );
  689.         foreach ($this->getWalkers() as $walker) {
  690.             $walker->walkComparisonExpression($compExpr);
  691.         }
  692.     }
  693.     /**
  694.      * {@inheritdoc}
  695.      *
  696.      * @deprecated This method will be removed in 3.0.
  697.      */
  698.     public function walkInputParameter($inputParam)
  699.     {
  700.         Deprecation::trigger(
  701.             'doctrine/orm',
  702.             'https://github.com/doctrine/orm/pull/9551',
  703.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  704.             __METHOD__
  705.         );
  706.         foreach ($this->getWalkers() as $walker) {
  707.             $walker->walkInputParameter($inputParam);
  708.         }
  709.     }
  710.     /**
  711.      * {@inheritdoc}
  712.      *
  713.      * @deprecated This method will be removed in 3.0.
  714.      */
  715.     public function walkArithmeticExpression($arithmeticExpr)
  716.     {
  717.         Deprecation::trigger(
  718.             'doctrine/orm',
  719.             'https://github.com/doctrine/orm/pull/9551',
  720.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  721.             __METHOD__
  722.         );
  723.         foreach ($this->getWalkers() as $walker) {
  724.             $walker->walkArithmeticExpression($arithmeticExpr);
  725.         }
  726.     }
  727.     /**
  728.      * {@inheritdoc}
  729.      *
  730.      * @deprecated This method will be removed in 3.0.
  731.      */
  732.     public function walkArithmeticTerm($term)
  733.     {
  734.         Deprecation::trigger(
  735.             'doctrine/orm',
  736.             'https://github.com/doctrine/orm/pull/9551',
  737.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  738.             __METHOD__
  739.         );
  740.         foreach ($this->getWalkers() as $walker) {
  741.             $walker->walkArithmeticTerm($term);
  742.         }
  743.     }
  744.     /**
  745.      * {@inheritdoc}
  746.      *
  747.      * @deprecated This method will be removed in 3.0.
  748.      */
  749.     public function walkStringPrimary($stringPrimary)
  750.     {
  751.         Deprecation::trigger(
  752.             'doctrine/orm',
  753.             'https://github.com/doctrine/orm/pull/9551',
  754.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  755.             __METHOD__
  756.         );
  757.         foreach ($this->getWalkers() as $walker) {
  758.             $walker->walkStringPrimary($stringPrimary);
  759.         }
  760.     }
  761.     /**
  762.      * {@inheritdoc}
  763.      *
  764.      * @deprecated This method will be removed in 3.0.
  765.      */
  766.     public function walkArithmeticFactor($factor)
  767.     {
  768.         Deprecation::trigger(
  769.             'doctrine/orm',
  770.             'https://github.com/doctrine/orm/pull/9551',
  771.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  772.             __METHOD__
  773.         );
  774.         foreach ($this->getWalkers() as $walker) {
  775.             $walker->walkArithmeticFactor($factor);
  776.         }
  777.     }
  778.     /**
  779.      * {@inheritdoc}
  780.      *
  781.      * @deprecated This method will be removed in 3.0.
  782.      */
  783.     public function walkSimpleArithmeticExpression($simpleArithmeticExpr)
  784.     {
  785.         Deprecation::trigger(
  786.             'doctrine/orm',
  787.             'https://github.com/doctrine/orm/pull/9551',
  788.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  789.             __METHOD__
  790.         );
  791.         foreach ($this->getWalkers() as $walker) {
  792.             $walker->walkSimpleArithmeticExpression($simpleArithmeticExpr);
  793.         }
  794.     }
  795.     /**
  796.      * {@inheritdoc}
  797.      *
  798.      * @deprecated This method will be removed in 3.0.
  799.      */
  800.     public function walkPathExpression($pathExpr)
  801.     {
  802.         Deprecation::trigger(
  803.             'doctrine/orm',
  804.             'https://github.com/doctrine/orm/pull/9551',
  805.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  806.             __METHOD__
  807.         );
  808.         foreach ($this->getWalkers() as $walker) {
  809.             $walker->walkPathExpression($pathExpr);
  810.         }
  811.     }
  812.     /**
  813.      * {@inheritdoc}
  814.      *
  815.      * @deprecated This method will be removed in 3.0.
  816.      */
  817.     public function walkResultVariable($resultVariable)
  818.     {
  819.         Deprecation::trigger(
  820.             'doctrine/orm',
  821.             'https://github.com/doctrine/orm/pull/9551',
  822.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  823.             __METHOD__
  824.         );
  825.         foreach ($this->getWalkers() as $walker) {
  826.             $walker->walkResultVariable($resultVariable);
  827.         }
  828.     }
  829.     /**
  830.      * {@inheritdoc}
  831.      *
  832.      * @deprecated This method will be removed in 3.0.
  833.      */
  834.     public function getExecutor($AST)
  835.     {
  836.         Deprecation::trigger(
  837.             'doctrine/orm',
  838.             'https://github.com/doctrine/orm/pull/9551',
  839.             'Method "%s" is deprecated and will be removed in ORM 3.0 without replacement.',
  840.             __METHOD__
  841.         );
  842.         return null;
  843.     }
  844.     /** @psalm-return Generator<int, TreeWalker> */
  845.     private function getWalkers(): Generator
  846.     {
  847.         foreach ($this->walkers as $walkerClass) {
  848.             yield new $walkerClass($this->query$this->parserResult$this->queryComponents);
  849.         }
  850.     }
  851. }