-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console] Only show namespaces with commands #19776
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
Conversation
6cfd593
to
65a187f
Compare
return isset($commands[$name]); | ||
}); | ||
|
||
if (empty($namespace['commands'])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually just if (!$namespace['commands']) {
👍 Nice catch, command aliases are already listed in the description of the original command, no need for listing them twice. |
65a187f
to
7214bdd
Compare
|
||
if (!$namespace['commands']) { | ||
continue; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should add a test case for this new logic
@ro0NL This one looks really good... but tests need to be added. |
Closing in favor of #19954 |
…(ro0NL) This PR was merged into the 3.3-dev branch. Discussion ---------- [Console] Exclude empty namespaces in text descriptor | Q | A | | --- | --- | | Branch? | "master" | | Bug fix? | yes | | New feature? | no | | BC breaks? | no | | Deprecations? | no | | Tests pass? | yes | | Fixed tickets | comma-separated list of tickets fixed by the PR, if any | | License | MIT | | Doc PR | reference to the documentation PR, if any | Before: ``` $ bin/console doctrine doctrine:mapping:convert [orm:convert:mapping] Convert mapping information between supported formats. orm <---- router router:match Helps debug routes by simulating a path info match $ bin/console list orm [Symfony\Component\Debug\Exception\ContextErrorException] Warning: max(): Array must contain at least one element $ bin/console list generate Available commands for the "generate" namespace: generate:bundle Generates a bundle generate:command Generates a console command generate:controller Generates a controller ``` After: ``` $ bin/console doctrine doctrine:mapping:convert [orm:convert:mapping] Convert mapping information between supported formats. router router:match Helps debug routes by simulating a path info match $ bin/console list orm Available commands for the "orm" namespace: orm:convert:mapping Convert mapping information between supported formats. $ bin/console list generate Available commands for the "generate" namespace: generate:bundle Generates a bundle generate:command Generates a console command generate:controller Generates a controller generate:doctrine:crud Generates a CRUD based on a Doctrine entity generate:doctrine:entities Generates entity classes and method stubs from your mapping information generate:doctrine:entity Generates a new Doctrine entity inside a bundle generate:doctrine:form Generates a form type class based on a Doctrine entity ``` Overrules #19776 but also includes other fixes related to aliases that popped up when writing tests 👍 Commits ------- d5a7608 [Console] Exclude empty namespaces in text descriptor
Only namespaces which has commands to show should be shown. Like orm:convert:mapping being an alias to doctrine:mapping:convert making orm namespace showing up empty.