diff --git a/rules/CodeQuality/Rector/Class_/DynamicDocBlockPropertyToNativePropertyRector.php b/rules/CodeQuality/Rector/Class_/DynamicDocBlockPropertyToNativePropertyRector.php index dc91c94315d..8829edb50fd 100644 --- a/rules/CodeQuality/Rector/Class_/DynamicDocBlockPropertyToNativePropertyRector.php +++ b/rules/CodeQuality/Rector/Class_/DynamicDocBlockPropertyToNativePropertyRector.php @@ -4,7 +4,6 @@ namespace Rector\CodeQuality\Rector\Class_; use PhpParser\Node; -use PhpParser\Node\Attribute; use PhpParser\Node\Expr; use PhpParser\Node\Stmt\Class_; use PhpParser\Node\Stmt\ClassMethod; @@ -16,7 +15,7 @@ use Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocTagRemover; use Rector\CodeQuality\NodeFactory\TypedPropertyFactory; use Rector\Comments\NodeDocBlock\DocBlockUpdater; -use Rector\Doctrine\NodeAnalyzer\AttributeFinder; +use Rector\Php80\NodeAnalyzer\PhpAttributeAnalyzer; use Rector\PhpParser\Node\Value\ValueResolver; use Rector\PHPUnit\NodeAnalyzer\TestsNodeAnalyzer; use Rector\Rector\AbstractRector; @@ -32,9 +31,9 @@ final class DynamicDocBlockPropertyToNativePropertyRector extends AbstractRector { /** * @readonly - * @var \Rector\Doctrine\NodeAnalyzer\AttributeFinder + * @var \Rector\Php80\NodeAnalyzer\PhpAttributeAnalyzer */ - private $attributeFinder; + private $phpAttributeAnalyzer; /** * @readonly * @var \Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory @@ -65,9 +64,9 @@ final class DynamicDocBlockPropertyToNativePropertyRector extends AbstractRector * @var \Rector\PhpParser\Node\Value\ValueResolver */ private $valueResolver; - public function __construct(AttributeFinder $attributeFinder, PhpDocInfoFactory $phpDocInfoFactory, PhpDocTagRemover $phpDocTagRemover, DocBlockUpdater $docBlockUpdater, TypedPropertyFactory $typedPropertyFactory, TestsNodeAnalyzer $testsNodeAnalyzer, ValueResolver $valueResolver) + public function __construct(PhpAttributeAnalyzer $phpAttributeAnalyzer, PhpDocInfoFactory $phpDocInfoFactory, PhpDocTagRemover $phpDocTagRemover, DocBlockUpdater $docBlockUpdater, TypedPropertyFactory $typedPropertyFactory, TestsNodeAnalyzer $testsNodeAnalyzer, ValueResolver $valueResolver) { - $this->attributeFinder = $attributeFinder; + $this->phpAttributeAnalyzer = $phpAttributeAnalyzer; $this->phpDocInfoFactory = $phpDocInfoFactory; $this->phpDocTagRemover = $phpDocTagRemover; $this->docBlockUpdater = $docBlockUpdater; @@ -115,8 +114,7 @@ public function getNodeTypes() : array */ public function refactor(Node $node) : ?Node { - $allowDynamicPropertiesAttribute = $this->attributeFinder->findAttributeByClass($node, 'AllowDynamicProperties'); - if (!$allowDynamicPropertiesAttribute instanceof Attribute) { + if (!$this->phpAttributeAnalyzer->hasPhpAttribute($node, 'AllowDynamicProperties')) { return null; } if ($this->shouldSkipClass($node)) { diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 50b6da6ed0a..e5e61ae567a 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 = '385d423d4f2b5577bfb5d70f6e41e09f3460a057'; + public const PACKAGE_VERSION = '61016bf5307b804df5babb81db27cacbccb12efa'; /** * @api * @var string */ - public const RELEASE_DATE = '2024-10-12 23:24:13'; + public const RELEASE_DATE = '2024-10-12 23:33:01'; /** * @var int */