Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ public function getNodeTypes(): array
public function refactor(Node $node)
{
$phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($node);

// make rule idempotent, do not add if already present
if ($phpDocInfo->getVarTagValueNode() instanceof VarTagValueNode) {
return null;
}

$varTagValueNode = new VarTagValueNode(new FullyQualifiedIdentifierTypeNode('DateTime'), '', '');

$phpDocInfo->addTagValueNode($varTagValueNode);
Expand Down
Loading