Skip to content

Commit 0183b70

Browse files
jan-pintrnicolas-grekas
authored andcommitted
Fix AsCronTask not passing arguments to command
1 parent 5fd65e1 commit 0183b70

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

DependencyInjection/AddScheduleMessengerPass.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ public function process(ContainerBuilder $container): void
5858
if ($serviceDefinition->hasTag('console.command')) {
5959
/** @var AsCommand|null $attribute */
6060
$attribute = ($container->getReflectionClass($serviceDefinition->getClass())->getAttributes(AsCommand::class)[0] ?? null)?->newInstance();
61-
$message = new Definition(RunCommandMessage::class, [$attribute?->name ?? $serviceDefinition->getClass()::getDefaultName().(empty($tagAttributes['arguments']) ? '' : " {$tagAttributes['arguments']}")]);
61+
$commandName = $attribute?->name ?? $serviceDefinition->getClass()::getDefaultName();
62+
63+
$message = new Definition(RunCommandMessage::class, [$commandName.($tagAttributes['arguments'] ? " {$tagAttributes['arguments']}" : '')]);
6264
} else {
6365
$message = new Definition(ServiceCallMessage::class, [$serviceId, $tagAttributes['method'] ?? '__invoke', (array) ($tagAttributes['arguments'] ?? [])]);
6466
}

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