class ResultData extends Data implements ExitCodeInterface, OutputDataInterface (View source)

Constants

EXITCODE_OK

EXITCODE_ERROR

EXITCODE_MISSING_OPTIONS

Symfony Console handles these conditions; Robo returns the status code selected by Symfony. These are here for documentation purposes.

EXITCODE_COMMAND_NOT_FOUND

EXITCODE_USER_CANCEL

The command was aborted because the user chose to cancel it at some prompt.

This exit code is arbitrarily the same as EX_TEMPFAIL in sysexits.h, although note that shell error codes are distinct from C exit codes, so this alignment not particularly meaningful.

Properties

protected string $message from  Data
protected int $exitCode

Methods

__construct(int $exitCode = self::EXITCODE_OK, string $message = '', array $data = [])

No description

array
getData()

No description

from  Data
string
getMessage()

No description

from  Data
setMessage(string $message)

No description

from  Data
$this
merge(Data $result)

Merge another result into this result. Data already existing in this result takes precedence over the data in the Result being merged.

from  Data
$this
update(ArrayObject $update)

Update the current data with the data provided in the parameter.

from  Data
array
mergeData(array $data)

Merge another result into this result. Data already existing in this result takes precedence over the data in the Result being merged.

from  Data
bool
hasExecutionTime()

No description

from  Data
null|float
getExecutionTime()

No description

from  Data
null|float
accumulateExecutionTime(array|float $duration)

Accumulate execution time

from  Data
string
accumulateMessage(string $message)

Accumulate the message.

from  Data
static ResultData
message(string $message, array $data = [])

No description

static ResultData
cancelled(string $message = '', array $data = [])

No description

getExitCode()

No description

getOutputData()

No description

alreadyPrinted()

Indicate that the message in this data has already been displayed.

provideOutputdata()

Opt-in to providing the result message as the output data

bool
wasSuccessful()

No description

bool
wasCancelled()

No description

Details

__construct(int $exitCode = self::EXITCODE_OK, string $message = '', array $data = [])

No description

Parameters

int $exitCode
string $message
array $data

array getData()

No description

Return Value

array

string getMessage()

No description

Return Value

string

setMessage(string $message)

No description

Parameters

string $message

$this merge(Data $result)

Merge another result into this result. Data already existing in this result takes precedence over the data in the Result being merged.

Parameters

Data $result

Return Value

$this

$this update(ArrayObject $update)

Update the current data with the data provided in the parameter.

Provided data takes precedence.

Parameters

ArrayObject $update

Return Value

$this

array mergeData(array $data)

Merge another result into this result. Data already existing in this result takes precedence over the data in the Result being merged.

$data['message'] is handled specially, and is appended to $this->message if set.

Parameters

array $data

Return Value

array

bool hasExecutionTime()

No description

Return Value

bool

null|float getExecutionTime()

No description

Return Value

null|float

null|float accumulateExecutionTime(array|float $duration)

Accumulate execution time

Parameters

array|float $duration

Return Value

null|float

string accumulateMessage(string $message)

Accumulate the message.

Parameters

string $message

Return Value

string

static ResultData message(string $message, array $data = [])

No description

Parameters

string $message
array $data

Return Value

ResultData

static ResultData cancelled(string $message = '', array $data = [])

No description

Parameters

string $message
array $data

Return Value

ResultData

getExitCode()

No description

getOutputData()

No description

alreadyPrinted()

Indicate that the message in this data has already been displayed.

provideOutputdata()

Opt-in to providing the result message as the output data

bool wasSuccessful()

No description

Return Value

bool

bool wasCancelled()

No description

Return Value

bool