|
17 | 17 | use PhpParser\Node\Expr\BinaryOp\Pipe; |
18 | 18 | use PhpParser\Node\Expr\CallLike; |
19 | 19 | use PhpParser\Node\Expr\Instanceof_; |
20 | | -use PhpParser\Node\Expr\Match_; |
21 | 20 | use PhpParser\Node\Expr\MethodCall; |
22 | 21 | use PhpParser\Node\Expr\Ternary; |
23 | 22 | use PhpParser\Node\Expr\Yield_; |
|
29 | 28 | use PhpParser\Node\Stmt\Nop; |
30 | 29 | use PhpParser\PrettyPrinter\Standard; |
31 | 30 | use PhpParser\Token; |
32 | | -use PHPStan\Node\Expr\AlwaysRememberedExpr; |
33 | 31 | use Rector\Configuration\Option; |
34 | 32 | use Rector\Configuration\Parameter\SimpleParameterProvider; |
35 | 33 | use Rector\NodeAnalyzer\ExprAnalyzer; |
@@ -116,21 +114,6 @@ protected function pInterpolatedStringPart(InterpolatedStringPart $interpolatedS |
116 | 114 | #[Override] |
117 | 115 | protected function p(Node $node, int $precedence = self::MAX_PRECEDENCE, int $lhsPrecedence = self::MAX_PRECEDENCE, bool $parentFormatPreserved = \false): string |
118 | 116 | { |
119 | | - // handle already AlwaysRememberedExpr |
120 | | - // @see https://github.com/rectorphp/rector/issues/8815#issuecomment-2503453191 |
121 | | - if ($node instanceof AlwaysRememberedExpr) { |
122 | | - return $this->p($node->getExpr(), $precedence, $lhsPrecedence, $parentFormatPreserved); |
123 | | - } |
124 | | - // handle overlapped origNode is Match_ and its subnodes still have AlwaysRememberedExpr |
125 | | - $originalNode = $node->getAttribute(AttributeKey::ORIGINAL_NODE); |
126 | | - if ($originalNode instanceof Match_) { |
127 | | - $subNodeNames = $node->getSubNodeNames(); |
128 | | - foreach ($subNodeNames as $subNodeName) { |
129 | | - while ($originalNode->{$subNodeName} instanceof AlwaysRememberedExpr) { |
130 | | - $originalNode->{$subNodeName} = $originalNode->{$subNodeName}->getExpr(); |
131 | | - } |
132 | | - } |
133 | | - } |
134 | 117 | $this->wrapBinaryOpWithBrackets($node); |
135 | 118 | $content = parent::p($node, $precedence, $lhsPrecedence, $parentFormatPreserved); |
136 | 119 | // remove once its fixed in php-parser, https://github.com/nikic/PHP-Parser/pull/1126 |
|
0 commit comments