Skip to content

Commit

Permalink
[TypeDeclaration] Do not use Required::class reference on AutowiredCl…
Browse files Browse the repository at this point in the history
…assMethodOrPropertyAnalyzer (#5788)
  • Loading branch information
samsonasik committed Apr 1, 2024
1 parent 0f1987b commit 724899c
Showing 1 changed file with 1 addition and 2 deletions.
Expand Up @@ -9,7 +9,6 @@
use PhpParser\Node\Stmt\Property;
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory;
use Rector\Php80\NodeAnalyzer\PhpAttributeAnalyzer;
use Symfony\Contracts\Service\Attribute\Required;

final readonly class AutowiredClassMethodOrPropertyAnalyzer
{
Expand All @@ -26,6 +25,6 @@ public function detect(ClassMethod | Param | Property $node): bool
return true;
}

return $this->phpAttributeAnalyzer->hasPhpAttributes($node, [Required::class, 'Nette\DI\Attributes\Inject']);
return $this->phpAttributeAnalyzer->hasPhpAttributes($node, ['Symfony\Contracts\Service\Attribute\Required', 'Nette\DI\Attributes\Inject']);
}
}

0 comments on commit 724899c

Please sign in to comment.