interface ProcessResult

Methods

string
command()

Get the original command executed by the process.

bool
successful()

Determine if the process was successful.

bool
failed()

Determine if the process failed.

int|null
exitCode()

Get the exit code of the process.

string
output()

Get the standard output of the process.

bool
seeInOutput(string $output)

Determine if the output contains the given string.

string
errorOutput()

Get the error output of the process.

bool
seeInErrorOutput(string $output)

Determine if the error output contains the given string.

throw(callable|null $callback = null)

Throw an exception if the process failed.

throwIf(bool $condition, callable|null $callback = null)

Throw an exception if the process failed and the given condition is true.

Details

at line 12
string command()

Get the original command executed by the process.

Return Value

string

at line 17
bool successful()

Determine if the process was successful.

Return Value

bool

at line 22
bool failed()

Determine if the process failed.

Return Value

bool

at line 27
int|null exitCode()

Get the exit code of the process.

Return Value

int|null

at line 32
string output()

Get the standard output of the process.

Return Value

string

at line 37
bool seeInOutput(string $output)

Determine if the output contains the given string.

Parameters

string $output

Return Value

bool

at line 42
string errorOutput()

Get the error output of the process.

Return Value

string

at line 47
bool seeInErrorOutput(string $output)

Determine if the error output contains the given string.

Parameters

string $output

Return Value

bool

at line 52
ProcessResult throw(callable|null $callback = null)

Throw an exception if the process failed.

Parameters

callable|null $callback

Return Value

ProcessResult

at line 57
ProcessResult throwIf(bool $condition, callable|null $callback = null)

Throw an exception if the process failed and the given condition is true.

Parameters

bool $condition
callable|null $callback

Return Value

ProcessResult