Skip to content

Commit

Permalink
[Console] Fix deprecation when description is null
Browse files Browse the repository at this point in the history
str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
  • Loading branch information
HypeMC committed Jun 7, 2022
1 parent 9481924 commit 56f40c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion DependencyInjection/AddConsoleCommandPass.php
Expand Up @@ -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) {
Expand Down

0 comments on commit 56f40c9

Please sign in to comment.