diff --git a/packages/better-php-doc-parser/src/Printer/PhpDocInfoPrinter.php b/packages/better-php-doc-parser/src/Printer/PhpDocInfoPrinter.php index 853c844d9025..770802256ad1 100644 --- a/packages/better-php-doc-parser/src/Printer/PhpDocInfoPrinter.php +++ b/packages/better-php-doc-parser/src/Printer/PhpDocInfoPrinter.php @@ -6,7 +6,6 @@ use Nette\Utils\Strings; use PHPStan\PhpDocParser\Ast\PhpDoc\GenericTagValueNode; -use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocNode; use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagNode; use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTextNode; use PHPStan\PhpDocParser\Lexer\Lexer; @@ -122,11 +121,6 @@ public function printFormatPreserving(PhpDocInfo $phpDocInfo): string private function printPhpDocNode(AttributeAwarePhpDocNode $attributeAwarePhpDocNode): string { - // no nodes were, so empty doc - if ($this->isPhpDocNodeEmpty($attributeAwarePhpDocNode)) { - return ''; - } - $this->currentTokenPosition = 0; $output = ''; @@ -158,25 +152,6 @@ private function removeExtraSpacesAfterAsterisk(string $phpDocString): string return Strings::replace($phpDocString, '#([^*])\*[ \t]+$#sm', '$1*'); } - private function isPhpDocNodeEmpty(PhpDocNode $phpDocNode): bool - { - if (count($phpDocNode->children) === 0) { - return true; - } - - foreach ($phpDocNode->children as $phpDocChildNode) { - if ($phpDocChildNode instanceof PhpDocTextNode) { - if ($phpDocChildNode->text !== '') { - return false; - } - } else { - return false; - } - } - - return true; - } - private function printNode( AttributeAwareNodeInterface $attributeAwareNode, ?StartEndValueObject $startEndValueObject = null,