From 1d90e7c45b7488884aeaf2c7a71c1f7cddf157d3 Mon Sep 17 00:00:00 2001 From: Julien Rosset Date: Tue, 6 Oct 2026 17:59:58 +0200 Subject: [PATCH] =?UTF-8?q?CommandCall=20:=20autorise=20d=C3=A9sormais=20l?= =?UTF-8?q?e=20string-class=20de=20la=20commande?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/CliProgram/CommandCall/CommandCall.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/CliProgram/CommandCall/CommandCall.php b/src/CliProgram/CommandCall/CommandCall.php index a6596c3..be680f2 100644 --- a/src/CliProgram/CommandCall/CommandCall.php +++ b/src/CliProgram/CommandCall/CommandCall.php @@ -78,9 +78,11 @@ class CommandCall { * @return $this */ public function setCommandName (string|Command $commandName): self { - $this->commandName = $commandName instanceof Command - ? CliHelper::getCommandNameFromClass($commandName->getApplication(), $commandName::class) - : $commandName; + $this->commandName = match (true) { + $commandName instanceof Command => CliHelper::getCommandNameFromClass($commandName->getApplication(), $commandName::class), + is_a($commandName, Command::class, true) => CliHelper::getCommandNameFromClass($commandName->getApplication(), $commandName), + default => $commandName, + }; return $this; }