Closed
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?