Skip to content

Commit

Permalink
Fix dependency set
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Sep 26, 2023
1 parent 902adad commit 8eaba9b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions utils/Rector/RemoveVarTagFromClassConstantRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,23 @@
use PhpParser\Node;
use PhpParser\Node\Stmt\ClassConst;
use PHPStan\PhpDocParser\Ast\PhpDoc\VarTagValueNode;
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory;
use Rector\Comments\NodeDocBlock\DocBlockUpdater;
use Rector\Core\Rector\AbstractRector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;

final class RemoveVarTagFromClassConstantRector extends AbstractRector
{
private PhpDocInfoFactory $phpDocInfoFactory;
private DocBlockUpdater $docBlockUpdater;

public function __construct(PhpDocInfoFactory $phpDocInfoFactory, DocBlockUpdater $docBlockUpdater)
{
$this->phpDocInfoFactory = $phpDocInfoFactory;
$this->docBlockUpdater = $docBlockUpdater;
}

public function getRuleDefinition(): RuleDefinition
{
return new RuleDefinition('Remove @var tag from class constant', [
Expand Down Expand Up @@ -64,6 +75,8 @@ public function refactor(Node $node): ?Node

$phpDocInfo->removeByType(VarTagValueNode::class);

$this->docBlockUpdater->updateRefactoredNodeWithPhpDocInfo($node);

return $node;
}
}

0 comments on commit 8eaba9b

Please sign in to comment.