From 715ba20b57e26590b88b04a8b725c5cf78673533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frederic=20G=2E=20=C3=98stby?= Date: Wed, 23 Oct 2024 22:11:37 +0200 Subject: [PATCH] Change default value to an empty string instead of null --- src/mako/reactor/Reactor.php | 2 +- src/mako/reactor/attributes/Command.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mako/reactor/Reactor.php b/src/mako/reactor/Reactor.php index 9bfb55e8c..4eabbad21 100644 --- a/src/mako/reactor/Reactor.php +++ b/src/mako/reactor/Reactor.php @@ -194,7 +194,7 @@ protected function getCommandDescription(ReflectionClass $class): string return $command->getDescription(); } - return (string) $attributes[0]->newInstance()->getDescription(); + return $attributes[0]->newInstance()->getDescription(); } /** diff --git a/src/mako/reactor/attributes/Command.php b/src/mako/reactor/attributes/Command.php index cdf1f8bc2..3ddc0f255 100644 --- a/src/mako/reactor/attributes/Command.php +++ b/src/mako/reactor/attributes/Command.php @@ -20,7 +20,7 @@ class Command */ public function __construct( protected string $name, - protected ?string $description = null, + protected string $description = '', ) { } @@ -35,7 +35,7 @@ public function getName(): string /** * Returns the command description. */ - public function getDescription(): ?string + public function getDescription(): string { return $this->description; }