GroupDefinition extends CommandDefinition
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
- $defaultCommandName : string
- Name of a command to be run as default for this group
- $definitions : array<string|int, mixed>
- List of sub commands / groups
- $noCommandsMessage : string
- Message shown if no commands are available
- beforeAction() : GroupDefinition
- Define an action to run before any command of this group
- 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
- getBeforeAction() : string|null
- Return the before action
- getBeforeActionParams() : array<string|int, mixed>
- Return the before action params
- getDefaultCommandName() : string|null
- Returns the default command name
- getNoCommandsMessage() : string|null
- Returns the no commands available message
- group() : GroupDefinition
- Add a group
- noCommandAvailable() : GroupDefinition
- Set a message shown if no command is available in this group
- toArray() : mixed
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
= []
$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
= []
$noCommandsMessage
Message shown if no commands are available
protected
string
$noCommandsMessage
Methods
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 —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> —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> —getDefaultCommandName()
Returns the default command name
public
getDefaultCommandName() : string|null
Return values
string|null —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 —noCommandAvailable()
Set a message shown if no command is available in this group
public
noCommandAvailable(string $message) : GroupDefinition
Parameters
- $message : string
Return values
GroupDefinition —toArray()
public
toArray() : mixed