RouterDebugCommand
class RouterDebugCommand extends Command
A console command for retrieving information about routes.
Properties
static protected | $defaultName |
Methods
Checks whether the command is enabled or not in the current environment.
Configures the current command.
Initializes the command after the input has been bound and before the input is validated.
Merges the application definition with the command definition.
Gets the InputDefinition to be used to create representations of this Command.
Adds an argument.
Adds an option.
Returns the processed help for the command replacing the %command.name% and %command.full_name% patterns with the real values dynamically.
Details
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.
protected int|null
execute(InputInterface $input, OutputInterface $output)
Executes the current command.
This method is not abstract because you can use this class as a concrete class. In this case, instead of defining the execute() method, you set the code to execute by passing a Closure to the setCode() method.
protected
interact(InputInterface $input, OutputInterface $output)
Interacts with the user.
This method is executed before the InputDefinition is validated. This means that this is the only place where the command can interactively ask for values of missing required arguments.
protected
initialize(InputInterface $input, OutputInterface $output)
Initializes the command after the input has been bound and before the input is validated.
This is mainly useful when a lot of commands extends one main command where some things need to be initialized based on the input arguments and options.
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.
$this
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.
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.
$this
setDefinition(array|InputDefinition $definition)
Sets an array of argument and option instances.
InputDefinition
getNativeDefinition()
Gets the InputDefinition to be used to create representations of this Command.
Can be overridden to provide the original command representation when it would otherwise be changed by merging with the application InputDefinition.
This method is not part of public API and should not be used directly.
$this
addArgument(string $name, int|null $mode = null, string $description = '', string|string[]|null $default = null)
Adds an argument.
$this
addOption(string $name, string|array $shortcut = null, int|null $mode = null, string $description = '', string|string[]|int|bool|null $default = null)
Adds an option.
$this
setName(string $name)
Sets the name of the command.
This method can set both the namespace and the name if you separate them by a colon (:)
$command->setName('foo:bar');
$this
setProcessTitle(string $title)
Sets the process title of the command.
This feature should be used only when creating a long process command, like a daemon.
PHP 5.5+ or the proctitle PECL library is required