diff --git a/src/Visitor.php b/src/Visitor.php index 968a8cd4..f4c608a2 100644 --- a/src/Visitor.php +++ b/src/Visitor.php @@ -77,7 +77,7 @@ public function enterNode(Node $node) return null; } - $node = $this->getCleanCommentsNode($node); + $this->cleanComments($node); $docComment = $node->getDocComment(); @@ -879,10 +879,10 @@ static function (Node $node): bool { return null; } - private function getCleanCommentsNode(Node $node): Node + private function cleanComments(Node $node): void { if (count($node->getComments()) === 0) { - return $node; + return; } $comments = []; @@ -908,7 +908,5 @@ private function getCleanCommentsNode(Node $node): Node } $node->setAttribute('comments', $comments); - - return $node; } }