File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212use function explode ;
1313use function implode ;
1414use function json_decode ;
15+ use function rtrim ;
1516use function strpos ;
1617use function substr ;
1718
@@ -49,6 +50,8 @@ private static function decodeLines(iterable $lines): Generator
4950 $ streamedExceptionLines = [];
5051
5152 foreach ($ lines as $ line ) {
53+ $ line = rtrim ($ line , "\r" );
54+
5255 if ($ streamedExceptionLines !== []) {
5356 $ streamedExceptionLines [] = $ line ;
5457
Original file line number Diff line number Diff line change 1515
1616use function iterator_to_array ;
1717use function str_repeat ;
18+ use function str_replace ;
1819
1920#[CoversClass(JsonEachRow::class)]
2021final class JsonEachRowTest extends TestCaseBase
@@ -94,5 +95,7 @@ public static function provideStreamedExceptionContents(): iterable
9495
9596 yield 'string ' => [$ contents ];
9697 yield 'stream ' => [Utils::streamFor ($ contents )];
98+ yield 'CRLF string ' => [str_replace ("\n" , "\r\n" , $ contents )];
99+ yield 'CRLF stream ' => [Utils::streamFor (str_replace ("\n" , "\r\n" , $ contents ))];
97100 }
98101}
You can’t perform that action at this time.
0 commit comments