Skip to content

Commit 2cbbec4

Browse files
committed
bug #46608 [Console] Fix deprecation when description is null (HypeMC)
This PR was merged into the 5.4 branch. Discussion ---------- [Console] Fix deprecation when description is null | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Fixes `str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated` when `getDefaultDescription()` returns `null`, caused by #46574. Commits ------- 7a08b52 [Console] Fix deprecation when description is null
2 parents 8d0d9fa + 7a08b52 commit 2cbbec4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Console/DependencyInjection/AddConsoleCommandPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public function process(ContainerBuilder $container)
124124
if (!$r->isSubclassOf(Command::class)) {
125125
throw new InvalidArgumentException(sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, $this->commandTag, Command::class));
126126
}
127-
$description = str_replace('%', '%%', $class::getDefaultDescription());
127+
$description = str_replace('%', '%%', $class::getDefaultDescription() ?? '');
128128
}
129129

130130
if ($description) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy