classCommandResult
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 $exitCodepublic string $output = ''public string $error = ''Methods§
public function __construct(
public ExitCode $exitCode,
public string $output = '',
public string $error = '',
)Parameters
$exitCode | ExitCode | What to tell the shell |
$output | string | What to write to standard output |
$error | string | What to write to standard error |
public static function ok(string $output): selfA result that only writes to standard output.
Parameters
$output | string |
Returns
selfTest cases 1
Called from 3
- static-call SqlCatalog\Cli\CatalogCommand::answerQuery() packages/sql-catalog/src/Cli/CatalogCommand.php:116
- static-call SqlCatalog\Cli\CatalogCommand::answerQuery() packages/sql-catalog/src/Cli/CatalogCommand.php:119
- static-call SqlCatalog\Cli\CatalogCommand::answerQuery() packages/sql-catalog/src/Cli/CatalogCommand.php:122
Calls 2
- new
selfline 34 - class-const ExitCode::Success() line 34
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
CatalogCommandTestcalls
Relations§
Instantiated in 2
Static calls 5
- static-call SqlCatalog\Cli\CatalogCommand::run() packages/sql-catalog/src/Cli/CatalogCommand.php:58
- static-call SqlCatalog\Cli\CatalogCommand::run() packages/sql-catalog/src/Cli/CatalogCommand.php:60
- static-call SqlCatalog\Cli\CatalogCommand::answerQuery() packages/sql-catalog/src/Cli/CatalogCommand.php:116
- static-call SqlCatalog\Cli\CatalogCommand::answerQuery() packages/sql-catalog/src/Cli/CatalogCommand.php:119
- static-call SqlCatalog\Cli\CatalogCommand::answerQuery() packages/sql-catalog/src/Cli/CatalogCommand.php:122
Type declarations 4
- type SqlCatalog\Cli\CatalogCommand packages/sql-catalog/src/Cli/CatalogCommand.php:53
- type SqlCatalog\Cli\CatalogCommand packages/sql-catalog/src/Cli/CatalogCommand.php:74
- type SqlCatalog\Cli\CatalogCommand packages/sql-catalog/src/Cli/CatalogCommand.php:112
- type SqlCatalog\Cli\CatalogCommand packages/sql-catalog/src/Cli/CatalogCommand.php:131