You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
After updating from 4.3.9 to 4.3.10 the changes from #35094 lead to loading of lazy commands although they are not actually called. This occurs with commands where the first part of the name matches. For example if you have two lazy commands app:foo and app:foo:bar, and call bin/console app:foo, then app:foo:bar will also be instantiated. This should not happen according to the documentation (link). I think the problem is line 668 in Symfony\Component\Console\Application.php where the command always get instantiated even if it is a lazy command.
How to reproduce
Create two lazy commands where the first part of the name matches, i.e. app:foo and app:foo:bar:
Call bin/console app:foo. The console output shows that FooBarCommand get also instantiated.
Possible Solution
I think the problem is line 668 in Symfony\Component\Console\Application.php where the command always get instantiated just to get its name even if it is a lazy command.
…match (chalasr)
This PR was merged into the 3.4 branch.
Discussion
----------
[Console] Don't load same-namespace alternatives on exact match
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#35479
| License | MIT
| Doc PR | -
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.
Additionally (see https://symfony.com/roadmap):
- Always add tests and ensure they pass.
- Never break backward compatibility (see https://symfony.com/bc).
- Bug fixes must be submitted against the lowest maintained branch where they apply
(lowest branches are regularly merged to upper ones so they get the fixes too.)
- Features and deprecations must be submitted against branch master.
-->
Commits
-------
707c5ba [Console] Don't load same-namespace alternatives on exact match found
Uh oh!
There was an error while loading. Please reload this page.
Symfony version(s) affected: 4.3.10
Description
After updating from 4.3.9 to 4.3.10 the changes from #35094 lead to loading of lazy commands although they are not actually called. This occurs with commands where the first part of the name matches. For example if you have two lazy commands
app:foo
andapp:foo:bar
, and callbin/console app:foo
, thenapp:foo:bar
will also be instantiated. This should not happen according to the documentation (link). I think the problem is line 668 in Symfony\Component\Console\Application.php where the command always get instantiated even if it is a lazy command.How to reproduce
app:foo
andapp:foo:bar
:bin/console app:foo
. The console output shows thatFooBarCommand
get also instantiated.Possible Solution
I think the problem is line 668 in Symfony\Component\Console\Application.php where the command always get instantiated just to get its name even if it is a lazy command.
Additional context
The text was updated successfully, but these errors were encountered: