Closed
Description
Commands have 3 lifecycle methods:
initialize($input, $output)
interact($input, $output)
execute($input, $output)
At first, they might seem redundant and the docs doesn't tell a lot about the difference between them. It turns out interact()
is called before the validation of the input definition. This means that this is the only place where the command can interactively ask for values of missing options. executes()
contains the logic of the Command. It's the only required method of the three.