-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console] Cannot change input arguments on ConsoleCommandEvent #52415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
Can you confirm this bug is also present in 5.4? |
Yes, just tested this, can confirm this bug exists in 5.4, too. |
This is a known limitation. PR welcome if one wants to give it a try, but I'm going to close here since we already went back & forth without success on this one and concluded it was a won't fix. |
Does it make sense then to mention this in the event class? |
Looks sensible to me yes |
fschmtt
added a commit
to fschmtt/symfony
that referenced
this issue
Nov 17, 2023
fabpot
added a commit
that referenced
this issue
Nov 18, 2023
This PR was submitted for the 7.1 branch but it was merged into the 5.4 branch instead. Discussion ---------- Hint that changing input arguments has no effect | Q | A | ------------- | --- | Branch? | 7.1 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | #52415 | License | MIT Adding a hint to `\Symfony\Component\Console\Event\ConsoleCommandEvent` that changing the input arguments has no effect. Commits ------- 9ec9ead Add hint that changing input arguments has no effect
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Symfony version(s) affected
Description
When subscribing to the
console.command
and modifying the input arguments, the command receives the original, unmodified arguments.How to reproduce
Create a subscriber changing the input arguments, e.g.:
Run
bin/console messenger:consume async
. The subscriber should addlow_priority
as an additionalreceiver
. The command receives the unmodified input argument, though:❯ php bin/console messenger:consume async [OK] Consuming messages from transport "async".
Possible Solution
Possibly the input arguments get bound too early. They are bound in both
symfony/src/Symfony/Component/Console/Command/Command.php
Line 285 in 6c3d377
symfony/src/Symfony/Component/Console/Application.php
Line 237 in 6c3d377
Additional Context
No response
The text was updated successfully, but these errors were encountered: