AlterOptionsCommandEvent
class AlterOptionsCommandEvent implements EventSubscriberInterface (View source)
AlterOptionsCommandEvent is a subscriber to the Command Event that looks up any additional options (e.g. from an OPTION_HOOK) that should be added to the command. Options need to be added in two circumstances:
-
When 'help' for the command is called, so that the additional command options may be listed in the command description.
-
When the command itself is called, so that option validation may be done.
We defer the addition of options until these times so that we do not invoke the option hooks for every command on every run of the program, and so that we do not need to defer the addition of all of the application hooks until after all of the application commands have been added. (Hooks may appear in the same command files as command implementations; applications may support command file plug-ins, and hooks may add options to commands defined in other commandfiles.)
Properties
protected | $application | var Application |
Methods
No description
No description
No description
No description
Details
__construct(Application $application)
No description
alterCommandOptions(ConsoleCommandEvent $event)
No description
findAndAddHookOptions($command)
No description
static
getSubscribedEvents()
No description