diff --git a/packages/BetterPhpDocParser/PhpDocParser/DoctrineAnnotationDecorator.php b/packages/BetterPhpDocParser/PhpDocParser/DoctrineAnnotationDecorator.php index 4044b3135884..1727c800903d 100644 --- a/packages/BetterPhpDocParser/PhpDocParser/DoctrineAnnotationDecorator.php +++ b/packages/BetterPhpDocParser/PhpDocParser/DoctrineAnnotationDecorator.php @@ -203,7 +203,7 @@ private function transformGenericTagValueNodesToDoctrineAnnotationTagValueNodes( $this->attributeMirrorer->mirror($phpDocNode->children[$key], $spacelessPhpDocTagNode); $phpDocNode->children[$key] = $spacelessPhpDocTagNode; // require to reprint the generic - $phpDocNode->children[$key]->setAttribute(PhpDocAttributeKey::IS_AFTER_GENERIC, \true); + $phpDocNode->children[$key]->value->setAttribute(PhpDocAttributeKey::ORIG_NODE, null); \array_splice($phpDocNode->children, $key + 1, 0, $spacelessPhpDocTagNodes); } } diff --git a/packages/BetterPhpDocParser/Printer/PhpDocInfoPrinter.php b/packages/BetterPhpDocParser/Printer/PhpDocInfoPrinter.php index 83b6f683a77c..facb2a27f3d3 100644 --- a/packages/BetterPhpDocParser/Printer/PhpDocInfoPrinter.php +++ b/packages/BetterPhpDocParser/Printer/PhpDocInfoPrinter.php @@ -15,7 +15,6 @@ use PHPStan\PhpDocParser\Ast\PhpDoc\ThrowsTagValueNode; use PHPStan\PhpDocParser\Ast\PhpDoc\VarTagValueNode; use PHPStan\PhpDocParser\Lexer\Lexer; -use Rector\BetterPhpDocParser\PhpDoc\SpacelessPhpDocTagNode; use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo; use Rector\BetterPhpDocParser\PhpDocNodeVisitor\ChangedPhpDocNodeVisitor; use Rector\BetterPhpDocParser\ValueObject\PhpDocAttributeKey; @@ -279,10 +278,7 @@ private function correctPreviouslyReprintedFirstNode(int $key, StartAndEnd $star private function shouldReprint(PhpDocChildNode $phpDocChildNode) : bool { $this->changedPhpDocNodeTraverser->traverse($phpDocChildNode); - if ($this->changedPhpDocNodeVisitor->hasChanged()) { - return \true; - } - return $phpDocChildNode instanceof SpacelessPhpDocTagNode && $phpDocChildNode->getAttribute(PhpDocAttributeKey::IS_AFTER_GENERIC) === \true; + return $this->changedPhpDocNodeVisitor->hasChanged(); } private function standardPrintPhpDocChildNode(PhpDocChildNode $phpDocChildNode) : string { diff --git a/packages/BetterPhpDocParser/ValueObject/PhpDocAttributeKey.php b/packages/BetterPhpDocParser/ValueObject/PhpDocAttributeKey.php index f4442390c941..85a046fbbdff 100644 --- a/packages/BetterPhpDocParser/ValueObject/PhpDocAttributeKey.php +++ b/packages/BetterPhpDocParser/ValueObject/PhpDocAttributeKey.php @@ -27,8 +27,4 @@ final class PhpDocAttributeKey * @var string */ public const ORIG_NODE = NativePhpDocAttributeKey::ORIG_NODE; - /** - * @var string - */ - public const IS_AFTER_GENERIC = 'is_after_generic'; } diff --git a/packages/PhpDocParser/PhpDocParser/PhpDocNodeVisitor/CloningPhpDocNodeVisitor.php b/packages/PhpDocParser/PhpDocParser/PhpDocNodeVisitor/CloningPhpDocNodeVisitor.php index a93655ecde99..bcda65d4c9f0 100644 --- a/packages/PhpDocParser/PhpDocParser/PhpDocNodeVisitor/CloningPhpDocNodeVisitor.php +++ b/packages/PhpDocParser/PhpDocParser/PhpDocNodeVisitor/CloningPhpDocNodeVisitor.php @@ -16,7 +16,9 @@ final class CloningPhpDocNodeVisitor extends \Rector\PhpDocParser\PhpDocParser\P public function enterNode(Node $node) : Node { $clonedNode = clone $node; - $clonedNode->setAttribute(PhpDocAttributeKey::ORIG_NODE, $node); + if (!$clonedNode->hasAttribute(PhpDocAttributeKey::ORIG_NODE)) { + $clonedNode->setAttribute(PhpDocAttributeKey::ORIG_NODE, $node); + } return $clonedNode; } } diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index e08ac013ae19..02f44a149205 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -19,12 +19,12 @@ final class VersionResolver * @api * @var string */ - public const PACKAGE_VERSION = '5adf574161ebce53984822da71d711e3b2ba10e9'; + public const PACKAGE_VERSION = '3f42ee98ffefc73677b93308fe53508bd260a574'; /** * @api * @var string */ - public const RELEASE_DATE = '2023-11-25 08:45:31'; + public const RELEASE_DATE = '2023-11-25 11:54:21'; /** * @var int */