Skip to content

Commit

Permalink
Replace ternary return value with match expression
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Nov 11, 2023
1 parent dcbf1ac commit c46db81
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/framework/src/Console/Commands/ServeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ protected function useBasicOutput(): bool
protected function parseEnvironmentOption(string $name): ?string
{
if ($this->option($name) !== null) {
return $this->option($name) !== 'false' ? 'enabled' : 'disabled';
return match ($this->option($name)) {
'true', '' => 'enabled',
'false' => 'disabled',
default => null
};
}

return null;
Expand Down

0 comments on commit c46db81

Please sign in to comment.