Merge pull request #409 from phpDocumentor/enable-integration-tests

Fix newline detection on descriptions
This commit is contained in:
Jaap van Otterdijk
2025-04-13 21:20:35 +02:00
committed by GitHub
2 changed files with 14 additions and 8 deletions
+8
View File
@@ -48,3 +48,11 @@ jobs:
with:
composer-root-version: "5.x-dev"
upcoming-releases: true
integration-tests:
name: "Integration test"
uses: "phpDocumentor/.github/.github/workflows/[email protected]"
with:
composer-root-version: "5.x-dev"
upcoming-releases: true
test-suite: "integration"
@@ -73,16 +73,14 @@ 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)
rtrim($ast->value->description . $tokens->joinUntil(Lexer::TOKEN_END), "\n")
);
}
}
if ($context === null) {
$context = new TypeContext('');