From 7a08b52048af0704d4010986f392c62909dd1f9e 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 --- .../Console/DependencyInjection/AddConsoleCommandPass.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Console/DependencyInjection/AddConsoleCommandPass.php b/src/Symfony/Component/Console/DependencyInjection/AddConsoleCommandPass.php index c55c5db4e3be8..1fbb212e78a26 100644 --- a/src/Symfony/Component/Console/DependencyInjection/AddConsoleCommandPass.php +++ b/src/Symfony/Component/Console/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) {