DataSift\Storyplayer\Cli\PlayStory_Command::initReporting PHP Method

initReporting() protected method

protected initReporting ( Phix_Project\CliEngine $engine, DataSift\Storyplayer\Injectables $injectables ) : void
$engine Phix_Project\CliEngine
$injectables DataSift\Storyplayer\Injectables
return void
    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
    }