@@ -280,9 +280,7 @@ protected function flushOutputBuffer()
280
280
->map (fn ($ line ) => trim ($ line ))
281
281
->filter ()
282
282
->each (function ($ line ) {
283
- $ stringable = new Stringable ($ line );
284
-
285
- if ($ stringable ->contains ('Development Server (http ' )) {
283
+ if ((new Stringable ($ line ))->contains ('Development Server (http ' )) {
286
284
if ($ this ->serverRunningHasBeenDisplayed === false ) {
287
285
$ this ->serverRunningHasBeenDisplayed = true ;
288
286
@@ -295,19 +293,23 @@ protected function flushOutputBuffer()
295
293
return ;
296
294
}
297
295
298
- $ requestPort = static ::getRequestPortFromLine ($ line );
296
+ if ((new Stringable ($ line ))->contains (' Accepted ' )) {
297
+ $ requestPort = static ::getRequestPortFromLine ($ line );
299
298
300
- if ($ stringable ->contains (' Accepted ' )) {
301
299
$ this ->requestsPool [$ requestPort ] = [
302
300
$ this ->getDateFromLine ($ line ),
303
301
$ this ->requestsPool [$ requestPort ][1 ] ?? false ,
304
302
microtime (true ),
305
303
];
306
- } elseif ($ stringable ->contains ([' [200]: GET ' ])) {
304
+ } elseif ((new Stringable ($ line ))->contains ([' [200]: GET ' ])) {
305
+ $ requestPort = static ::getRequestPortFromLine ($ line );
306
+
307
307
$ this ->requestsPool [$ requestPort ][1 ] = trim (explode ('[200]: GET ' , $ line )[1 ]);
308
- } elseif ($ stringable ->contains ('URI: ' )) {
308
+ } elseif ((new Stringable ($ line ))->contains ('URI: ' )) {
309
+ $ requestPort = static ::getRequestPortFromLine ($ line );
310
+
309
311
$ this ->requestsPool [$ requestPort ][1 ] = trim (explode ('URI: ' , $ line )[1 ]);
310
- } elseif ($ stringable ->contains (' Closing ' )) {
312
+ } elseif (( new Stringable ( $ line )) ->contains (' Closing ' )) {
311
313
$ requestPort = static ::getRequestPortFromLine ($ line );
312
314
313
315
if (empty ($ this ->requestsPool [$ requestPort ])) {
@@ -338,11 +340,11 @@ protected function flushOutputBuffer()
338
340
339
341
$ this ->output ->write (' ' .str_repeat ('<fg=gray>.</> ' , $ dots ));
340
342
$ this ->output ->writeln (" <fg=gray>~ {$ runTime }</> " );
341
- } elseif ($ stringable ->contains (['Closed without sending a request ' , 'Failed to poll event ' ])) {
343
+ } elseif (( new Stringable ( $ line )) ->contains (['Closed without sending a request ' , 'Failed to poll event ' ])) {
342
344
// ...
343
345
} elseif (! empty ($ line )) {
344
- if ($ stringable ->startsWith ('[ ' )) {
345
- $ line = $ stringable ->after ('] ' );
346
+ if (( new Stringable ( $ line )) ->startsWith ('[ ' )) {
347
+ $ line = ( new Stringable ( $ line )) ->after ('] ' );
346
348
}
347
349
348
350
$ this ->output ->writeln (" <fg=gray> $ line</> " );
0 commit comments