From 14d88cede70957ee3fcd92c940b8b14d5c1fadc9 Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Mon, 1 Jan 2024 10:24:15 +0100 Subject: [PATCH] Fix missing array key issue with FrankenPHP --- src/Commands/StartFrankenPhpCommand.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Commands/StartFrankenPhpCommand.php b/src/Commands/StartFrankenPhpCommand.php index 96b105b84..13d230b06 100644 --- a/src/Commands/StartFrankenPhpCommand.php +++ b/src/Commands/StartFrankenPhpCommand.php @@ -268,11 +268,13 @@ protected function writeServerOutput($server) return $this->info($output); } - if (is_array($stream = json_decode($debug['msg'], true))) { + $message = $debug['msg'] ?? ''; + + if (is_array($stream = json_decode($message, true))) { return $this->handleStream($stream); } - if ($debug['msg'] == 'handled request') { + if ($message == 'handled request') { if (! $this->laravel->isLocal()) { return; } @@ -300,7 +302,7 @@ protected function writeServerOutput($server) } if ($debug['level'] === 'warn') { - return $this->warn($debug['msg']); + return $this->warn($message); } if ($debug['level'] !== 'info') { @@ -309,7 +311,7 @@ protected function writeServerOutput($server) return; } - return $this->error($debug['msg']); + return $this->error($message); } }); }