Skip to content
Closed
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
25 changes: 0 additions & 25 deletions packages/better-php-doc-parser/src/Printer/PhpDocInfoPrinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 = '';
Expand Down Expand Up @@ -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,
Expand Down