Command::setDescription()

Command setDescription(string $description) Sets the description for the command. Parameters string $description The description for the command Return Value Command The current instance

Command::setCode()

Command setCode(callable $code) Sets the code to execute when running this command. If this method is used, it overrides the code defined in the execute() method. Parameters callable $code A callable(InputInterface $input, OutputInterface $output) Return Value Command The current instance Exceptions InvalidArgumentException See also execute()

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::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::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::getUsages()

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

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::getName()

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

Command::ignoreValidationErrors()

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