Orpheus

CliResponse extends OutputResponse
in package

Table of Contents

Properties

$body  : string|null
The HTML body of the response
$code  : int
The returned response code
$controllerOutput  : string|null
The output of the controller when running it

Methods

__construct()  : mixed
Constructor
__toString()  : string
Get this response as string
collectFrom()  : void
Collect response data from parameters
generateFromException()  : static
Generate CliResponse from Exception
generateFromUserException()  : static
Generate CliResponse from UserException
getBody()  : string|null
Get the body
getCode()  : int
Get the code
getControllerOutput()  : string|null
Get the controller output
isSuccess()  : bool
process()  : void
Process the response
setBody()  : CliResponse
Set the body
setCode()  : CliResponse
Set the code
setControllerOutput()  : void
Set the controller output

Properties

$body

The HTML body of the response

protected string|null $body = null

$code

The returned response code

protected int $code

$controllerOutput

The output of the controller when running it

protected string|null $controllerOutput = null

Methods

__construct()

Constructor

public __construct([int|string $code = 0 ][, string|null $body = null ]) : mixed
Parameters
$code : int|string = 0
$body : string|null = null

__toString()

Get this response as string

public __toString() : string
Return values
string

collectFrom()

Collect response data from parameters

public collectFrom(string $layout[, array<string|int, mixed> $values = [] ]) : void
Parameters
$layout : string
$values : array<string|int, mixed> = []

generateFromException()

Generate CliResponse from Exception

public static generateFromException(Exception $exception[, array<string|int, mixed> $values = [] ]) : static
Parameters
$exception : Exception
$values : array<string|int, mixed> = []
Return values
static

generateFromUserException()

Generate CliResponse from UserException

public static generateFromUserException(UserException $exception[, array<string|int, mixed> $values = [] ]) : static
Parameters
$exception : UserException
$values : array<string|int, mixed> = []
Return values
static

getBody()

Get the body

public getBody() : string|null
Return values
string|null

getCode()

Get the code

public getCode() : int
Return values
int

getControllerOutput()

Get the controller output

public getControllerOutput() : string|null
Return values
string|null

isSuccess()

public isSuccess() : bool
Return values
bool

process()

Process the response

public process() : void

setControllerOutput()

Set the controller output

public setControllerOutput(string $controllerOutput) : void
Parameters
$controllerOutput : string

							
On this page

Search results