public function render(Report $report) { foreach ($report->getData() as $actionData) { $action = $actionData['action']; echo sprintf('%s: %s' . PHP_EOL, $action->getType(), $actionData['isSuccess'] ? 'Ok' : 'Error'); if (false === $actionData['isSuccess']) { echo ${$actionData}['output'] . PHP_EOL; } } }
public function run($sourcePath, Report $report) { $commandLine = $this->getParameter('command_line'); $process = new Process($commandLine, $sourcePath); $process->run(); $output = $process->getOutput(); if ($errorOutput = $process->getErrorOutput()) { $output .= 'Error output' . PHP_EOL . PHP_EOL . $process->getErrorOutput(); } $report->addActionData($this, $process->isSuccessful(), $output); }