Command
class Command (View source)
Constants
| ARG_NO_VALUE |
|
| ARG_OPTIONAL |
|
| ARG_REQUIRED |
|
| REGEX_NAME |
|
| REGEX_LONG |
|
| REGEX_SHORT |
|
Methods
Creates a command to be used with an Inphinit\Cli\Console instance
Define a option for command
If set to true, it will allow the command to receive invalid parameters, which will be passed to the third parameter of the callback
They get the name from the command
They obtain the (long) options that the command accepts
They obtain the short options that are equivalent to the (long) options
This method will be used automatically by the Inphinit\Cli\Console instance
Details
__construct(string $name, string|callable $callback)
Creates a command to be used with an Inphinit\Cli\Console instance
Command
setOption(string $long, string $short = null, string $mode = self::ARG_OPTIONAL, string $format = null, string $description = null)
Define a option for command
Command
enableResidual(bool $enable)
If set to true, it will allow the command to receive invalid parameters, which will be passed to the third parameter of the callback
string
getName()
They get the name from the command
array
getOptions()
They obtain the (long) options that the command accepts
array
getShortOptions()
They obtain the short options that are equivalent to the (long) options
mixed
response(array $entries)
This method will be used automatically by the Inphinit\Cli\Console instance