@@ -117,25 +117,21 @@ Command Lifecycle
117
117
118
118
Commands have three lifecycle methods:
119
119
120
- :method: `Symfony\\ Component\\ Console\\ Command\\ Command::initialize `
120
+ :method: `Symfony\\ Component\\ Console\\ Command\\ Command::initialize ` * (optional) *
121
121
This method is executed before the ``interact() `` and the ``execute() ``
122
- methods. It's main purpose is to initialize the variables used in the
123
- rest of the command methods.
122
+ methods. Its main purpose is to initialize variables used in the rest of
123
+ the command methods.
124
124
125
- :method: `Symfony\\ Component\\ Console\\ Command\\ Command::interact `
125
+ :method: `Symfony\\ Component\\ Console\\ Command\\ Command::interact ` * (optional) *
126
126
This method is executed after ``initialize() `` and before ``execute() ``.
127
127
Its purpose is to check if some of the options/arguments are missing
128
128
and interactively ask the user for those values. This is the last place
129
- where you can ask for missing options/arguments otherwise the command
130
- will throw an error.
129
+ where you can ask for missing options/arguments. After this command,
130
+ missing options/arguments will result in an error.
131
131
132
- :method: `Symfony\\ Component\\ Console\\ Command\\ Command::execute `
132
+ :method: `Symfony\\ Component\\ Console\\ Command\\ Command::execute ` * (required) *
133
133
This method is executed after ``interact() `` and ``initialize() ``.
134
- It contains the logic you want the command executes.
135
-
136
- Note that ``execute() `` is the only required method of the three.
137
-
138
- The ``initialize() `` and ``interact() `` methods are completely optional.
134
+ It contains the logic you want the command to execute.
139
135
140
136
.. _components-console-coloring :
141
137
0 commit comments