Skip to content

Commit d1c6c03

Browse files
committed
Fix issue with tag description end detection.
1 parent e2ad295 commit d1c6c03

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/DocBlock/Tags/Factory/AbstractPHPStanFactory.php

+6-8
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,13 @@ public function __construct(PHPStanFactory ...$factories)
7373

7474
public function create(string $tagLine, ?TypeContext $context = null): Tag
7575
{
76-
$tokens = $this->tokenizeLine($tagLine);
76+
$tokens = $this->tokenizeLine($tagLine . "\n");
7777
$ast = $this->parser->parseTag($tokens);
78-
if (class_exists(ParserConfig::class) === false) {
79-
if (property_exists($ast->value, 'description') === true) {
80-
$ast->value->setAttribute(
81-
'description',
82-
$ast->value->description . $tokens->joinUntil(Lexer::TOKEN_END)
83-
);
84-
}
78+
if (property_exists($ast->value, 'description') === true) {
79+
$ast->value->setAttribute(
80+
'description',
81+
rtrim($ast->value->description . $tokens->joinUntil(Lexer::TOKEN_END), "\n")
82+
);
8583
}
8684

8785
if ($context === null) {

0 commit comments

Comments
 (0)