10000 Handle 'hidden' param from AsCommand attribute by yoannrenard · Pull Request #41547 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Handle 'hidden' param from AsCommand attribute #41547

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

yoannrenard
Copy link
Contributor
@yoannrenard yoannrenard commented Jun 4, 2021
Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets
License MIT
Doc PR

The recently introduced AsCommand attribute works like a charm (as much as the whole 5.3 release 👌). Thanks a lot for that!

Though, it seems that the hidden property has been forgotten, whether one set it or not the command only checks the $this->hidden value set from the configure() method.

For example:

#[AsCommand(
    name: 'app:do:something',
    description: 'Will do something very cool.',
    aliases: [],
    hidden: true
)]
class DoSomethingCommand extends Command

When I run bash bin/console list app I get

Available commands for the "app" namespace:
  app:do:something  Do something very cool.

I implemented a fix inspired by the $name/$description properties.

@yoannrenard yoannrenard changed the title Handle 'hidden' param from AsCommand attribute [Console] Handle 'hidden' param from AsCommand attribute Jun 4, 2021
Copy link
Contributor
@OskarStark OskarStark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me except my comment