Skip to content

Commit 7afdf50

Browse files
committed
Fixed the help notes of the AddUser command
1 parent d3d7abb commit 7afdf50

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

src/AppBundle/Command/AddUserCommand.php

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,21 @@ protected function configure()
6161
}
6262

6363
/**
64-
* This method is executed before initialize() and execute(). Its purpose is
65-
* to check if some of the options/arguments are missing and interactively
64+
* This method is executed before the interact() and the execute() methods.
65+
* It's main purpose is to initialize the variables used in the rest of the
66+
* command methods.
67+
*
68+
* Beware that the input options and arguments are validated after executing
69+
* the interact() method, so you can't blindly trust their values in this method.
70+
*/
71+
protected function initialize(InputInterface $input, OutputInterface $output)
72+
{
73+
$this->em = $this->getContainer()->get('doctrine')->getManager();
74+
}
75+
76+
/**
77+
* This method is executed after initialize() and before execute(). Its purpose
78+
* is to check if some of the options/arguments are missing and interactively
6679
* ask the user for those values.
6780
*
6881
* This method is completely optional. If you are developing an internal console
@@ -147,16 +160,6 @@ protected function interact(InputInterface $input, OutputInterface $output)
147160
}
148161
}
149162

150-
/**
151-
* This method is executed before the interact() and the execute() methods.
152-
* It's main purpose is to initialize the variables used in the rest of the
153-
* command methods.
154-
*/
155-
protected function initialize(InputInterface $input, OutputInterface $output)
156-
{
157-
$this->em = $this->getContainer()->get('doctrine')->getManager();
158-
}
159-
160163
/**
161164
* This method is executed after interact() and initialize(). It usually
162165
* contains the logic to execute to complete this command task.

0 commit comments

Comments
 (0)