Skip to content

Commit 92dde6a

Browse files
authored
Merge pull request #409 from phpDocumentor/enable-integration-tests
Fix newline detection on descriptions
2 parents a549656 + d1c6c03 commit 92dde6a

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

.github/workflows/integrate.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,11 @@ jobs:
4848
with:
4949
composer-root-version: "5.x-dev"
5050
upcoming-releases: true
51+
52+
integration-tests:
53+
name: "Integration test"
54+
uses: "phpDocumentor/.github/.github/workflows/[email protected]"
55+
with:
56+
composer-root-version: "5.x-dev"
57+
upcoming-releases: true
58+
test-suite: "integration"

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)