@@ -46,7 +46,7 @@ want a command to create a user::
46
46
protected function execute(InputInterface $input, OutputInterface $output)
47
47
{
48
48
// ...
49
-
49
+
50
50
return 0;
51
51
}
52
52
}
@@ -148,7 +148,7 @@ the console::
148
148
// outputs a message without adding a "\n" at the end of the line
149
149
$output->write('You are about to ');
150
150
$output->write('create a user.');
151
-
151
+
152
152
return 0;
153
153
}
154
154
@@ -199,7 +199,7 @@ which returns an instance of
199
199
// (this example deletes the last two lines of the section)
200
200
$section1->clear(2);
201
201
// Output is now completely empty!
202
-
202
+
203
203
return 0;
204
204
}
205
205
}
@@ -241,7 +241,7 @@ Use input options or arguments to pass information to the command::
241
241
242
242
// retrieve the argument value using getArgument()
243
243
$output->writeln('Username: '.$input->getArgument('username'));
244
-
244
+
245
245
return 0;
246
246
}
247
247
@@ -292,7 +292,7 @@ as a service, you can use normal dependency injection. Imagine you have a
292
292
$this->userManager->create($input->getArgument('username'));
293
293
294
294
$output->writeln('User successfully generated!');
295
-
295
+
296
296
return 0;
297
297
}
298
298
}
@@ -317,8 +317,13 @@ command:
317
317
318
318
:method: `Symfony\\ Component\\ Console\\ Command\\ Command::execute ` *(required) *
319
319
This method is executed after ``interact() `` and ``initialize() ``.
320
- It contains the logic you want the command to execute.
321
- Must return an integer which will be used as the command `exit status `_.
320
+ It contains the logic you want the command to execute and it should
321
+ return an integer which will be used as the command `exit status `_.
322
+
323
+ .. deprecated :: 4.4
324
+
325
+ Not returning an integer with the exit status as the result of
326
+ ``execute() `` is deprecated since Symfony 4.4.
322
327
323
328
.. _console-testing-commands :
324
329
0 commit comments