Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Teach the user to write the command lazy loading
A lazy loaded command is instantiated only when it is called.
  • Loading branch information
SimonHeimberg authored Oct 9, 2018
commit a4bffe086b1de57cf0f56fe65bc5df2f5951a389
7 changes: 3 additions & 4 deletions console.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ want a command to create a user::

class CreateUserCommand extends Command
{
// the name of the command (the part after "bin/console")
protected static $defaultName = 'app:create-user';

protected function configure()
{
// ...
Expand All @@ -56,10 +59,6 @@ method. Then you can optionally define a help message and the
// ...
protected function configure()
{
$this
// the name of the command (the part after "bin/console")
->setName('app:create-user')

// the short description shown while running "php bin/console list"
->setDescription('Creates a new user.')

Expand Down