From 697e3ebc97efa697214569d65eccc05ac062a747 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Sat, 11 Nov 2023 19:29:29 +0100 Subject: [PATCH] Throw exception when supplied with invalid boolean value --- packages/framework/src/Console/Commands/ServeCommand.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/framework/src/Console/Commands/ServeCommand.php b/packages/framework/src/Console/Commands/ServeCommand.php index e803cba4ec9..72ea15c8de6 100644 --- a/packages/framework/src/Console/Commands/ServeCommand.php +++ b/packages/framework/src/Console/Commands/ServeCommand.php @@ -8,6 +8,7 @@ use Hyde\Hyde; use Hyde\Facades\Config; use Illuminate\Support\Arr; +use InvalidArgumentException; use Hyde\RealtimeCompiler\ConsoleOutput; use Illuminate\Support\Facades\Process; use LaravelZero\Framework\Commands\Command; @@ -114,7 +115,7 @@ protected function parseEnvironmentOption(string $name): ?string return match ($this->option($name)) { 'true', '' => 'enabled', 'false' => 'disabled', - default => null + default => throw new InvalidArgumentException(sprintf('Invalid boolean value for --%s option.', $name)) }; }