Documentation

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

$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 = []

$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

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>

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

Search results