classCommandHandler
final class CommandHandler
Runs one command: loads the project, executes the command and reports the result.
Methods§
public function __construct(private string $command)Parameters
$command | string | The command name |
public function __invoke(InputInterface $input, OutputInterface $output): intRuns the command.
Parameters
$input | InputInterface | The parsed command line |
$output | OutputInterface | Receives the JSON report or the terminal tables |
Returns
int 0 when the report passed, 1 otherwiseThrows
InvalidInputException When the configuration, a definition or an option is invalidJsonException When a document or the report cannot be encodedRuntimeException When a file cannot be written or readCalls 10
- static-call Options::fromInput() line 40
- method-call Loader::load() line 41
- new Loader line 41
- method-call Executor::execute() line 42
- new Executor line 42
- method-call
OutputInterface::writeln()line 44 - function-call
json_encodeline 44 - class-const
OutputInterface::OUTPUT_RAW()line 44 - method-call Reporter::render() line 46
- new Reporter line 46
Private surface 1§
Implementation details, listed for orientation only.
private string $commandTest cases 13§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 6
CommandHandlerTest::testInvokeRejectsAMissingConfigurationcallsCommandHandlerTest::testInvokeRendersTheTerminalReportcallsCommandHandlerTest::testInvokeReturnsOneForAFailedJsonReportcallsCommandHandlerTest::testInvokeReturnsOneForAFailedTerminalReportcallsCommandHandlerTest::testInvokeWritesThePrettyJsonReportcallsCommandHandlerTest::testInvokeWritesUnescapedSlashesAndUnicodecalls
Other tests reaching this symbol 7
CommandsTestcallsExtensionCommandTestcallsMarkdownCommandTestcallsSpecCommandTestcallsApplicationTestcallsCommandLineTestcallsOverviewTestcalls