protected function initReporting(CliEngine $engine, Injectables $injectables)
{
// are there any reporting modules to be loaded?
if (!isset($engine->options->reports)) {
// no
return;
}
// setup the reports that have been requested
$injectables->initReportLoaderSupport($injectables);
foreach ($engine->options->reports as $reportName => $reportFilename) {
try {
$report = $injectables->reportLoader->loadReport($reportName, ['filename' => $reportFilename]);
} catch (E4xx_NoSuchReport $e) {
$injectables->output->logCliError("no such report '{$reportName}'");
exit(1);
}
$injectables->output->usePluginInSlot($report, $reportName);
}
// all done
}