Command
class Command (View source)
Constants
| ARG_NO_VALUE |
|
| 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, entries that don't match any declared option will be collected as residues and passed to the third parameter of the callback, instead of throwing an exception.
If True, the command can only be executed in CLI
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|null $short = null, int $modes = 0, string|null $pattern = null, string|null $description = null)
Define a option for command
Command
enableResidues(bool $enable)
If set to true, entries that don't match any declared option will be collected as residues and passed to the third parameter of the callback, instead of throwing an exception.
Command
restrictToCli(bool $enable)
If True, the command can only be executed in CLI
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