Orpheus

CliRequest extends InputRequest
in package

Table of Contents

Constants

VERBOSITY_DEBUG  = 256
VERBOSITY_NORMAL  = 32
VERBOSITY_QUIET  = 16
VERBOSITY_VERBOSE  = 64
VERBOSITY_VERY_VERBOSE  = 128

Properties

$dryRun  : bool
$input  : array<string|int, mixed>|string|null
The input (like stdin)
$mainRequest  : static|null
The current main request
$parameters  : array<string|int, mixed>
The input parameters (inline parameters)
$path  : string
The path
$pathValues  : array<string|int, mixed>
The values in path
$route  : ControllerRoute|null
The found route for this request A request could exist without any route (e.g. Route initialization failed)
$verbosity  : int

Methods

__construct()  : mixed
Constructor
__toString()  : string
Get this request as string
cloneWithPath()  : InputRequest
Clone this request using another path (expecting a sub path)
findFirstMatchingRoute()  : array<string|int, mixed>
Find a matching route according to the request
generateFromEnvironment()  : CliRequest
Generate CliRequest from environment
getAllData()  : array<string|int, mixed>
Get all input data
getArgument()  : string|null
getArrayData()  : mixed
Get the data by key with array as default
getController()  : AbstractController
Get running controller
getData()  : mixed
Get a data by $key, assuming $default
getDefaultController()  : CliController
getInput()  : array<string|int, mixed>
Get input
getInputValue()  : mixed
Get the input by $key, assuming $default value
getMainRequest()  : InputRequest|null
Get the main input request
getOption()  : mixed
Get the option by $key, assuming $default value
getParameter()  : mixed
Get the parameter by $key, assuming $default value
getParameters()  : array<string|int, mixed>
Get all parameters
getPath()  : string
Get the path
getRoute()  : ControllerRoute|null
Get the route to this request
getRouteClass()  : string
Get the name of the route class associated to a CliRequest
getRouteName()  : string
Get the route name to this request
getRoutes()  : array<string|int, CliRoute>
Get all available routes
getUrl()  : string
Get the URL used for this request
getVerbosity()  : int
handleCurrentRequest()  : void
Handle the current request as a CliRequest one This method ends the script
hasArrayData()  : bool
Test if data $key is an array
hasData()  : bool
Test if data contains the $key
hasDataKey()  : bool
Test if path contains a value and return it as parameter
hasInput()  : bool
Test if request has any input
hasInputValue()  : bool
Test if input $key exists in this request
hasParameter()  : bool
Test if parameter $key exists in this request
isDebugVerbose()  : bool
isDryRun()  : bool
isVerbose()  : bool
isVeryVerbose()  : bool
matchPath()  : string
Test path is matching regex
process()  : OutputResponse
Process the request by finding a route and processing it
processRoute()  : OutputResponse
Process the given route
redirect()  : RedirectHttpResponse|null
Redirect response to $route
setDryRun()  : void
setRoute()  : InputRequest
Set the route to this request
setVerbosity()  : void
parseArguments()  : array<string|int, mixed>
Parse console arguments to parameters with option
setContent()  : CliRequest
Set the content (input & input type)
setInput()  : InputRequest
Set the input
setParameters()  : InputRequest
Set the parameters
setPath()  : InputRequest
Set the path

Constants

VERBOSITY_DEBUG

public mixed VERBOSITY_DEBUG = 256

VERBOSITY_NORMAL

public mixed VERBOSITY_NORMAL = 32

VERBOSITY_QUIET

public mixed VERBOSITY_QUIET = 16

VERBOSITY_VERBOSE

public mixed VERBOSITY_VERBOSE = 64

VERBOSITY_VERY_VERBOSE

public mixed VERBOSITY_VERY_VERBOSE = 128

Properties

$input

The input (like stdin)

protected array<string|int, mixed>|string|null $input

$mainRequest

The current main request

protected static static|null $mainRequest = null

$parameters

The input parameters (inline parameters)

protected array<string|int, mixed> $parameters

$pathValues

The values in path

protected array<string|int, mixed> $pathValues

$route

The found route for this request A request could exist without any route (e.g. Route initialization failed)

protected ControllerRoute|null $route = null

$verbosity

protected int $verbosity = self::VERBOSITY_NORMAL

Methods

__construct()

Constructor

public __construct(mixed $path, mixed $parameters, mixed $input) : mixed
Parameters
$path : mixed
$parameters : mixed
$input : mixed

__toString()

Get this request as string

public __toString() : string
Return values
string

cloneWithPath()

Clone this request using another path (expecting a sub path)

public cloneWithPath(string $path) : InputRequest
Parameters
$path : string
Return values
InputRequest

findFirstMatchingRoute()

Find a matching route according to the request

public findFirstMatchingRoute() : array<string|int, mixed>
Return values
array<string|int, mixed>

getAllData()

Get all input data

public getAllData() : array<string|int, mixed>
Return values
array<string|int, mixed>

getArgument()

public getArgument(int $index) : string|null
Parameters
$index : int
Return values
string|null

getArrayData()

Get the data by key with array as default

public getArrayData(string $key) : mixed
Parameters
$key : string

getData()

Get a data by $key, assuming $default

public getData(string $key[, mixed $default = null ]) : mixed
Parameters
$key : string
$default : mixed = null

getInput()

Get input

public getInput() : array<string|int, mixed>
Return values
array<string|int, mixed>

getInputValue()

Get the input by $key, assuming $default value

public getInputValue(string $key[, mixed $default = null ]) : mixed
Parameters
$key : string
$default : mixed = null

getOption()

Get the option by $key, assuming $default value

public getOption(string $key[, string|null $short = null ][, mixed|null $default = null ]) : mixed
Parameters
$key : string
$short : string|null = null
$default : mixed|null = null

getParameter()

Get the parameter by $key, assuming $default value

public getParameter(string $key[, mixed|null $default = null ]) : mixed
Parameters
$key : string
$default : mixed|null = null

getParameters()

Get all parameters

public getParameters() : array<string|int, mixed>
Return values
array<string|int, mixed>

getPath()

Get the path

public getPath() : string
Return values
string

getRouteClass()

Get the name of the route class associated to a CliRequest

public static getRouteClass() : string
Return values
string

getRouteName()

Get the route name to this request

public getRouteName() : string
Return values
string

getUrl()

Get the URL used for this request

public getUrl() : string
Return values
string

getVerbosity()

public getVerbosity() : int
Return values
int

handleCurrentRequest()

Handle the current request as a CliRequest one This method ends the script

public static handleCurrentRequest() : void

hasArrayData()

Test if data $key is an array

public hasArrayData([string $key = null ]) : bool
Parameters
$key : string = null
Return values
bool

hasData()

Test if data contains the $key

public hasData([string|null $key = null ]) : bool
Parameters
$key : string|null = null
Return values
bool

hasDataKey()

Test if path contains a value and return it as parameter

public hasDataKey([string $path = null ][, string &$value = null ]) : bool
Parameters
$path : string = null

The path to get the value

$value : string = null

The value as output parameter

Return values
bool

hasInput()

Test if request has any input

public hasInput() : bool
Return values
bool

hasInputValue()

Test if input $key exists in this request

public hasInputValue(string $key) : bool
Parameters
$key : string
Return values
bool

hasParameter()

Test if parameter $key exists in this request

public hasParameter(string $key) : bool
Parameters
$key : string
Return values
bool

isDebugVerbose()

public isDebugVerbose() : bool
Return values
bool

isDryRun()

public isDryRun() : bool
Return values
bool

isVerbose()

public isVerbose() : bool
Return values
bool

isVeryVerbose()

public isVeryVerbose() : bool
Return values
bool

matchPath()

Test path is matching regex

public matchPath(string $regex, array<string|int, mixed>|null &$matches) : string
Parameters
$regex : string
$matches : array<string|int, mixed>|null
Return values
string

setDryRun()

public setDryRun(bool $dryRun) : void
Parameters
$dryRun : bool

setVerbosity()

public setVerbosity(int $verbosity) : void
Parameters
$verbosity : int

parseArguments()

Parse console arguments to parameters with option

protected static parseArguments(array<string|int, mixed> $args) : array<string|int, mixed>
Parameters
$args : array<string|int, mixed>
Return values
array<string|int, mixed>

setContent()

Set the content (input & input type)

protected setContent(string $content) : CliRequest
Parameters
$content : string
Tags
deprecated

Function is wrongly implemented

Return values
CliRequest

setInput()

Set the input

protected setInput(array<string|int, mixed>|string|null $input) : InputRequest
Parameters
$input : array<string|int, mixed>|string|null
Return values
InputRequest

setParameters()

Set the parameters

protected setParameters(array<string|int, mixed> $parameters) : InputRequest
Parameters
$parameters : array<string|int, mixed>
Return values
InputRequest

							
On this page

Search results