Cli extends ApplicationDefinition
Table of Contents
- $Command : string
- $commandMode : string
- $description : string
- $group : GroupDefinition
- $name : string
- $BeforeAction : string
- Action to run before any command of this group
- $beforeActionParams : array<string|int, mixed>
- Params for the before action
- $BeforeCommand : string
- Command to run before any command of this app
- $defaultCommandName : string
- Name of a command to be run as default for this group
- $definitions : array<string|int, mixed>
- List of sub commands / groups
- $infos : mixed
- Infos shown in CLI header
- $noCommandsMessage : string
- Message shown if no commands are available
- __construct() : mixed
- beforeAction() : GroupDefinition
- Define an action to run before any command of this group
- beforeCommand() : ApplicationDefinition
- Define a command to run before any command of this app
- command() : GroupDefinition
- Add a command
- default() : GroupDefinition
- Set a command of this group to be run instead of the index
- definitionsToCommands() : array<string|int, mixed>
- Converts command definitions to actual commands
- dumpCommandDefinitions() : ApplicationDefinition
- dumpCommands() : ApplicationDefinition
- getBeforeAction() : string|null
- Return the before action
- getBeforeActionParams() : array<string|int, mixed>
- Return the before action params
- getBeforeCommand() : string|null
- Return the before command
- getDefaultCommandName() : string|null
- Returns the default command name
- getInfos() : array<string|int, mixed>
- Get the cli header infos
- getNoCommandsMessage() : string|null
- Returns the no commands available message
- group() : GroupDefinition
- Add a group
- infos() : ApplicationDefinition
- Set infos to be shown in CLI header
- noCommandAvailable() : GroupDefinition
- Set a message shown if no command is available in this group
- run() : void
- toArray() : mixed
- getApplicationClass() : string
Properties
$Command
public
string
$Command
$commandMode
public
string
$commandMode
$description
public
string
$description
$group
public
GroupDefinition
$group
$name
public
string
$name
$BeforeAction
Action to run before any command of this group
protected
string
$BeforeAction
$beforeActionParams
Params for the before action
protected
array<string|int, mixed>
$beforeActionParams
= []
$BeforeCommand
Command to run before any command of this app
protected
string
$BeforeCommand
$defaultCommandName
Name of a command to be run as default for this group
protected
string
$defaultCommandName
$definitions
List of sub commands / groups
protected
array<string|int, mixed>
$definitions
= []
$infos
Infos shown in CLI header
protected
mixed
$infos
= []
$noCommandsMessage
Message shown if no commands are available
protected
string
$noCommandsMessage
Methods
__construct()
public
__construct([string|null $name = '' ]) : mixed
Parameters
- $name : string|null = ''
Return values
mixed —beforeAction()
Define an action to run before any command of this group
public
beforeAction(string $BeforeAction[, array<string|int, mixed> $params = [] ]) : GroupDefinition
Parameters
- $BeforeAction : string
- $params : array<string|int, mixed> = []
Return values
GroupDefinition —beforeCommand()
Define a command to run before any command of this app
public
beforeCommand(string $BeforeCommand) : ApplicationDefinition
Parameters
- $BeforeCommand : string
Return values
ApplicationDefinition —command()
Add a command
public
command(string $name, mixed $Command, string $description) : GroupDefinition
Parameters
- $name : string
- $Command : mixed
- $description : string
Return values
GroupDefinition —default()
Set a command of this group to be run instead of the index
public
default(string $name) : GroupDefinition
Parameters
- $name : string
Return values
GroupDefinition —definitionsToCommands()
Converts command definitions to actual commands
public
definitionsToCommands(Application $app[, Command|null $parentCommand = null ]) : array<string|int, mixed>
Parameters
- $app : Application
- $parentCommand : Command|null = null
Return values
array<string|int, mixed> —dumpCommandDefinitions()
public
dumpCommandDefinitions() : ApplicationDefinition
Return values
ApplicationDefinition —dumpCommands()
public
dumpCommands() : ApplicationDefinition
Return values
ApplicationDefinition —getBeforeAction()
Return the before action
public
getBeforeAction() : string|null
Return values
string|null —getBeforeActionParams()
Return the before action params
public
getBeforeActionParams() : array<string|int, mixed>
Return values
array<string|int, mixed> —getBeforeCommand()
Return the before command
public
getBeforeCommand() : string|null
Return values
string|null —getDefaultCommandName()
Returns the default command name
public
getDefaultCommandName() : string|null
Return values
string|null —getInfos()
Get the cli header infos
public
getInfos() : array<string|int, mixed>
Return values
array<string|int, mixed> —getNoCommandsMessage()
Returns the no commands available message
public
getNoCommandsMessage() : string|null
Return values
string|null —group()
Add a group
public
group(string $name, string $description, callable $callback) : GroupDefinition
Parameters
- $name : string
- $description : string
- $callback : callable
Return values
GroupDefinition —infos()
Set infos to be shown in CLI header
public
infos(array<string|int, mixed> $infos) : ApplicationDefinition
Parameters
- $infos : array<string|int, mixed>
Return values
ApplicationDefinition —noCommandAvailable()
Set a message shown if no command is available in this group
public
noCommandAvailable(string $message) : GroupDefinition
Parameters
- $message : string
Return values
GroupDefinition —run()
public
run() : void
Return values
void —toArray()
public
toArray() : mixed
Return values
mixed —getApplicationClass()
protected
getApplicationClass() : string