Properties

$args

$args : array

Console arguments

Type

array

$options

$options : array

Options found

Type

array

$commands

$commands : array

Commands found

Type

array

$env

$env : array

Console environment variables

Type

array

$scriptName

$scriptName : string

Console script name

Type

string

$requiredParamsNotFound

$requiredParamsNotFound : array

Required parameters that were not passed

Type

array

$parsed

$parsed : boolean

Parsed flag

Type

boolean

Methods

__construct()

__construct() : \Pop\Console\Request

Instantiate a new console request object

Throws

\Pop\Console\Exception

Returns

\Pop\Console\Request

hasArgument()

hasArgument(string  $arg) : boolean

Get a value from arguments array

Parameters

string $arg

Returns

boolean

getArguments()

getArguments() : array

Get the arguments array

Returns

array

getEnv()

getEnv(string  $key) : mixed

Get a value from environment variables array

Parameters

string $key

Returns

mixed

getEnvs()

getEnvs() : array

Get the environment variables array

Returns

array

getOption()

getOption(string  $key) : mixed

Get an option

Parameters

string $key

Returns

mixed

hasOption()

hasOption(string  $key) : boolean

Check if the request has an option

Parameters

string $key

Returns

boolean

getOptions()

getOptions() : array

Get the options found

Returns

array

getCommand()

getCommand(string  $key) : mixed

Get a command

Parameters

string $key

Returns

mixed

hasCommand()

hasCommand(string  $key) : boolean

Check if the request has a command

Parameters

string $key

Returns

boolean

getCommands()

getCommands() : array

Get the commands found

Returns

array

getScriptName()

getScriptName() : string

Get the script name

Returns

string

isValid()

isValid() : boolean

Determine if the request is valid

Returns

boolean

isParsed()

isParsed() : boolean

Determine if the request has been parsed yet or not

Returns

boolean

getRequiredParamsNotFound()

getRequiredParamsNotFound() : array

Get the required parameters not found

Returns

array

parse()

parse(array  $commands = array(), array  $options = array()) : void

Parse the request

Parameters

array $commands
array $options

setArguments()

setArguments(array  $args) : \Pop\Console\Request

Set the console arguments

Parameters

array $args

Returns

\Pop\Console\Request

setEnv()

setEnv(array  $env) : \Pop\Console\Request

Set the environment variables

Parameters

array $env

Returns

\Pop\Console\Request