Skip to content

Commit

Permalink
Updated Rector to commit 61016bf5307b804df5babb81db27cacbccb12efa
Browse files Browse the repository at this point in the history
rectorphp/rector-src@61016bf [CodeQuality] Use existing PhpAttributeAnalyzer service instead of AttributeFinder from Doctrine package on DynamicDocBlockPropertyToNativePropertyRector (#6382)
  • Loading branch information
TomasVotruba committed Oct 12, 2024
1 parent 80d5259 commit 1a957f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)) {
Expand Down
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit 1a957f8

Please sign in to comment.