From 56f40c96d6619cd87717a066f7ce65054bfd38b1 Mon Sep 17 00:00:00 2001 From: HypeMC Date: Tue, 7 Jun 2022 04:10:23 +0200 Subject: [PATCH] [Console] Fix deprecation when description is null str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated --- DependencyInjection/AddConsoleCommandPass.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DependencyInjection/AddConsoleCommandPass.php b/DependencyInjection/AddConsoleCommandPass.php index c55c5db4e..1fbb212e7 100644 --- a/DependencyInjection/AddConsoleCommandPass.php +++ b/DependencyInjection/AddConsoleCommandPass.php @@ -124,7 +124,7 @@ public function process(ContainerBuilder $container) if (!$r->isSubclassOf(Command::class)) { throw new InvalidArgumentException(sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, $this->commandTag, Command::class)); } - $description = str_replace('%', '%%', $class::getDefaultDescription()); + $description = str_replace('%', '%%', $class::getDefaultDescription() ?? ''); } if ($description) {