diff --git a/src/Support/PhpDoc.php b/src/Support/PhpDoc.php index ed794fc..9f8c84f 100644 --- a/src/Support/PhpDoc.php +++ b/src/Support/PhpDoc.php @@ -85,6 +85,7 @@ class PhpDoc ->implode("\n"); $text = Str::of($text) + ->replace("\r\n", "\n") ->trim() ->explode("\n\n", 2); diff --git a/tests/PhpDoc/PhpDocSummaryTest.php b/tests/PhpDoc/PhpDocSummaryTest.php new file mode 100644 index 0000000..27e0c61 --- /dev/null +++ b/tests/PhpDoc/PhpDocSummaryTest.php @@ -0,0 +1,22 @@ +getAttribute('summary'))->toBe('This is summary.') + ->and($node->getAttribute('description'))->toBe("This is a description.\nIt can span multiple lines."); +})->with([ + 'LF' => ["\n"], + 'CRLF' => ["\r\n"], +]);