Fix issue with tag description end detection.

This commit is contained in:
Jaapio
2025-04-13 21:16:25 +02:00
parent e2ad295cd6
commit d1c6c03eaa
@@ -73,15 +73,13 @@ class AbstractPHPStanFactory implements Factory
public function create(string $tagLine, ?TypeContext $context = null): Tag public function create(string $tagLine, ?TypeContext $context = null): Tag
{ {
$tokens = $this->tokenizeLine($tagLine); $tokens = $this->tokenizeLine($tagLine . "\n");
$ast = $this->parser->parseTag($tokens); $ast = $this->parser->parseTag($tokens);
if (class_exists(ParserConfig::class) === false) { if (property_exists($ast->value, 'description') === true) {
if (property_exists($ast->value, 'description') === true) { $ast->value->setAttribute(
$ast->value->setAttribute( 'description',
'description', rtrim($ast->value->description . $tokens->joinUntil(Lexer::TOKEN_END), "\n")
$ast->value->description . $tokens->joinUntil(Lexer::TOKEN_END) );
);
}
} }
if ($context === null) { if ($context === null) {