Skip to content

Commit 1a957f8

Browse files
committed
Updated Rector to commit 61016bf5307b804df5babb81db27cacbccb12efa
rectorphp/rector-src@61016bf [CodeQuality] Use existing PhpAttributeAnalyzer service instead of AttributeFinder from Doctrine package on DynamicDocBlockPropertyToNativePropertyRector (#6382)
1 parent 80d5259 commit 1a957f8

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

rules/CodeQuality/Rector/Class_/DynamicDocBlockPropertyToNativePropertyRector.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
namespace Rector\CodeQuality\Rector\Class_;
55

66
use PhpParser\Node;
7-
use PhpParser\Node\Attribute;
87
use PhpParser\Node\Expr;
98
use PhpParser\Node\Stmt\Class_;
109
use PhpParser\Node\Stmt\ClassMethod;
@@ -16,7 +15,7 @@
1615
use Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocTagRemover;
1716
use Rector\CodeQuality\NodeFactory\TypedPropertyFactory;
1817
use Rector\Comments\NodeDocBlock\DocBlockUpdater;
19-
use Rector\Doctrine\NodeAnalyzer\AttributeFinder;
18+
use Rector\Php80\NodeAnalyzer\PhpAttributeAnalyzer;
2019
use Rector\PhpParser\Node\Value\ValueResolver;
2120
use Rector\PHPUnit\NodeAnalyzer\TestsNodeAnalyzer;
2221
use Rector\Rector\AbstractRector;
@@ -32,9 +31,9 @@ final class DynamicDocBlockPropertyToNativePropertyRector extends AbstractRector
3231
{
3332
/**
3433
* @readonly
35-
* @var \Rector\Doctrine\NodeAnalyzer\AttributeFinder
34+
* @var \Rector\Php80\NodeAnalyzer\PhpAttributeAnalyzer
3635
*/
37-
private $attributeFinder;
36+
private $phpAttributeAnalyzer;
3837
/**
3938
* @readonly
4039
* @var \Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory
@@ -65,9 +64,9 @@ final class DynamicDocBlockPropertyToNativePropertyRector extends AbstractRector
6564
* @var \Rector\PhpParser\Node\Value\ValueResolver
6665
*/
6766
private $valueResolver;
68-
public function __construct(AttributeFinder $attributeFinder, PhpDocInfoFactory $phpDocInfoFactory, PhpDocTagRemover $phpDocTagRemover, DocBlockUpdater $docBlockUpdater, TypedPropertyFactory $typedPropertyFactory, TestsNodeAnalyzer $testsNodeAnalyzer, ValueResolver $valueResolver)
67+
public function __construct(PhpAttributeAnalyzer $phpAttributeAnalyzer, PhpDocInfoFactory $phpDocInfoFactory, PhpDocTagRemover $phpDocTagRemover, DocBlockUpdater $docBlockUpdater, TypedPropertyFactory $typedPropertyFactory, TestsNodeAnalyzer $testsNodeAnalyzer, ValueResolver $valueResolver)
6968
{
70-
$this->attributeFinder = $attributeFinder;
69+
$this->phpAttributeAnalyzer = $phpAttributeAnalyzer;
7170
$this->phpDocInfoFactory = $phpDocInfoFactory;
7271
$this->phpDocTagRemover = $phpDocTagRemover;
7372
$this->docBlockUpdater = $docBlockUpdater;
@@ -115,8 +114,7 @@ public function getNodeTypes() : array
115114
*/
116115
public function refactor(Node $node) : ?Node
117116
{
118-
$allowDynamicPropertiesAttribute = $this->attributeFinder->findAttributeByClass($node, 'AllowDynamicProperties');
119-
if (!$allowDynamicPropertiesAttribute instanceof Attribute) {
117+
if (!$this->phpAttributeAnalyzer->hasPhpAttribute($node, 'AllowDynamicProperties')) {
120118
return null;
121119
}
122120
if ($this->shouldSkipClass($node)) {

src/Application/VersionResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ final class VersionResolver
1919
* @api
2020
* @var string
2121
*/
22-
public const PACKAGE_VERSION = '385d423d4f2b5577bfb5d70f6e41e09f3460a057';
22+
public const PACKAGE_VERSION = '61016bf5307b804df5babb81db27cacbccb12efa';
2323
/**
2424
* @api
2525
* @var string
2626
*/
27-
public const RELEASE_DATE = '2024-10-12 23:24:13';
27+
public const RELEASE_DATE = '2024-10-12 23:33:01';
2828
/**
2929
* @var int
3030
*/

0 commit comments

Comments
 (0)