diff --git a/src/Parser/PhpDocParser.php b/src/Parser/PhpDocParser.php index 33d68968..c92b8093 100644 --- a/src/Parser/PhpDocParser.php +++ b/src/Parser/PhpDocParser.php @@ -230,7 +230,7 @@ private function parseText(TokenIterator $tokens): Ast\PhpDoc\PhpDocTextNode } $tokens->dropSavePoint(); - $text .= "\n"; + $text .= $tokens->getDetectedNewline() ?? "\n"; } return new Ast\PhpDoc\PhpDocTextNode(trim($text, " \t")); @@ -287,7 +287,7 @@ private function parseOptionalDescriptionAfterDoctrineTag(TokenIterator $tokens) } $tokens->dropSavePoint(); - $text .= "\n"; + $text .= $tokens->getDetectedNewline() ?? "\n"; } return trim($text, " \t");