-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
ConsoleactionableClear and specific issues ready for anyone to take them.Clear and specific issues ready for anyone to take them.hasPRA Pull Request has already been submitted for this issue.A Pull Request has already been submitted for this issue.
Milestone
Description
This issue was reported in the Symfony Slack.
- A user was reading https://symfony.com/doc/current/console.html
- Then he run
make:command
- He didn't see
->setName('...')
in the generated command, so he added->setName('app:mycommand')
himself. - Then he saw this error: ">>>There are no commands defined in the "app:mycommand" namespace"
The problem is:
- MakerBundle generates lazy commands by default (https://github.com/symfony/maker-bundle/blob/bf97703ddb68c6b37bd6bab5f5ebd5c7542ca1ef/src/Resources/skeleton/command/Command.tpl.php#L14), as explained in https://symfony.com/doc/3.4/console/commands_as_services.html#lazy-loading
- But most of the console docs don't use lazy commands.
What should we do here? Should we change all console docs to always use lazy commands?
mikemilano, vekien and php-evs
Metadata
Metadata
Assignees
Labels
ConsoleactionableClear and specific issues ready for anyone to take them.Clear and specific issues ready for anyone to take them.hasPRA Pull Request has already been submitted for this issue.A Pull Request has already been submitted for this issue.