CliCommand
extends Command
in package
Simple CLI Command implementation.
Table of Contents
Properties
Methods
- setClass() : static
- Return an instance with provided classname.
- setMethod() : static
- Return an instance with provided method callback.
- execute() : int
- Executes the current command.
Properties
$class
private
string
$class
= ''
$method
private
string
$method
= ''
Methods
setClass()
Return an instance with provided classname.
public
setClass(string $class) : static
Parameters
- $class : string
-
The classname.
Return values
staticsetMethod()
Return an instance with provided method callback.
public
setMethod(string $method) : static
Parameters
- $method : string
-
The method callback.
Return values
staticexecute()
Executes the current command.
protected
execute(InputInterface $input, OutputInterface $output) : int
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.
Parameters
- $input : InputInterface
- $output : OutputInterface
Tags
Return values
int —0 if everything went fine, or an exit code