final class CommandResult
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.

Everything one run of the command produced.

Holding the output instead of writing it keeps the command testable without capturing streams.

Properties§

public ExitCode $exitCode
public string $output = ''
public string $error = ''

Methods§

public function __construct(
    public ExitCode $exitCode,
    public string $output = '',
    public string $error = '',
)

Parameters

$exitCodeExitCodeWhat to tell the shell
$outputstringWhat to write to standard output
$errorstringWhat to write to standard error
public static function failure(ExitCode $exitCode, string $error): self

A result that reports a problem and nothing else.

Parameters

$exitCodeExitCode
$errorstring

Returns

self
Test cases 1
Called from 2
Calls 2

Test cases 3§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 2
Other tests reaching this symbol 1

Relations§

Instantiated in 2
Static calls 5
Type declarations 4