Command::setApplication()

setApplication(Application $application = null) Sets the application instance for this command. Parameters Application $application An Application instance

Command::setDefinition()

Command setDefinition(array|InputDefinition $definition) Sets an array of argument and option instances. Parameters array|InputDefinition $definition An array of argument and option instances or a definition instance Return Value Command The current instance

Command::run()

int run(InputInterface $input, OutputInterface $output) Runs the command. The code to execute is either defined directly with the setCode() method or by overriding the execute() method in a sub-class. Parameters InputInterface $input An InputInterface instance OutputInterface $output An OutputInterface instance Return Value int The command exit code Exceptions Exception See also setCode() execute()

Command::setAliases()

Command setAliases(string[] $aliases) Sets the aliases for the command. Parameters string[] $aliases An array of aliases for the command Return Value Command The current instance Exceptions InvalidArgumentException When an alias is invalid

Command::isEnabled()

bool isEnabled() Checks whether the command is enabled or not in the current environment. Override this to check for x or y and return false if the command can not run properly under the current conditions. Return Value bool

Command::mergeApplicationDefinition()

mergeApplicationDefinition(bool $mergeArgs = true) Merges the application definition with the command definition. This method is not part of public API and should not be used directly. Parameters bool $mergeArgs Whether to merge or not the Application definition arguments to Command definition arguments

Command::getUsages()

array getUsages() Returns alternative usages of the command. Return Value array

Command::getName()

string getName() Returns the command name. Return Value string The command name

Command::getProcessedHelp()

string getProcessedHelp() Returns the processed help for the command replacing the %command.name% and %command.full_name% patterns with the real values dynamically. Return Value string The processed help for the command

Command::ignoreValidationErrors()

ignoreValidationErrors() Ignores validation errors. This is mainly useful for the help command.