diff --git a/src/DocBlock/Tags/Factory/AbstractPHPStanFactory.php b/src/DocBlock/Tags/Factory/AbstractPHPStanFactory.php index e5b4e41..f8babab 100644 --- a/src/DocBlock/Tags/Factory/AbstractPHPStanFactory.php +++ b/src/DocBlock/Tags/Factory/AbstractPHPStanFactory.php @@ -73,15 +73,13 @@ class AbstractPHPStanFactory implements Factory public function create(string $tagLine, ?TypeContext $context = null): Tag { - $tokens = $this->tokenizeLine($tagLine); + $tokens = $this->tokenizeLine($tagLine . "\n"); $ast = $this->parser->parseTag($tokens); - if (class_exists(ParserConfig::class) === false) { - if (property_exists($ast->value, 'description') === true) { - $ast->value->setAttribute( - 'description', - $ast->value->description . $tokens->joinUntil(Lexer::TOKEN_END) - ); - } + if (property_exists($ast->value, 'description') === true) { + $ast->value->setAttribute( + 'description', + rtrim($ast->value->description . $tokens->joinUntil(Lexer::TOKEN_END), "\n") + ); } if ($context === null) {