public function createLogger(string $outputFormat, OutputInterface $reportOutput, OutputInterface $consoleOutput): LinterLoggerInterface
    {
        $errorOutput = ($consoleOutput instanceof ConsoleOutputInterface)
            ? $consoleOutput->getErrorOutput()
            : $consoleOutput;

        switch ($outputFormat) {
            case 'checkstyle':
            case 'xml':
                return new CompactConsoleLogger(new CheckstyleReportPrinter($reportOutput), $errorOutput);
            case 'txt':
            case 'text':
                return new VerboseConsoleLogger(new ConsoleReportPrinter($reportOutput), $consoleOutput);
            case 'compact':
                return new CompactConsoleLogger(new ConsoleReportPrinter($reportOutput), $consoleOutput);
            default:
                throw new \InvalidArgumentException('Invalid report printer "' . $outputFormat . '"!');
        }
    }
public function createLogger(string $outputFormat, OutputInterface $reportOutput, OutputInterface $consoleOutput): LinterLoggerInterface
    {
        $errorOutput = ($consoleOutput instanceof ConsoleOutputInterface)
            ? $consoleOutput->getErrorOutput()
            : $consoleOutput;

        switch ($outputFormat) {
            case 'checkstyle':
            case 'xml':
                return new CompactConsoleLogger(new CheckstyleReportPrinter($reportOutput), $errorOutput);
            case 'txt':
            case 'text':
                return new VerboseConsoleLogger(new ConsoleReportPrinter($reportOutput), $consoleOutput);
            case 'compact':
                return new CompactConsoleLogger(new ConsoleReportPrinter($reportOutput), $consoleOutput);
            default:
                throw new \InvalidArgumentException('Invalid report printer "' . $outputFormat . '"!');
        }
    }
public function createLogger ( string $ outputFormat , OutputInterface $ reportOutput , OutputInterface $ consoleOutput ) : LinterLoggerInterface { $ errorOutput = ( $ consoleOutput instanceof ConsoleOutputInterface ) ? $ consoleOutput -> getErrorOutput ( ) : $ consoleOutput ; switch ( $ outputFormat ) { case 'checkstyle' : case 'xml' : return new CompactConsoleLogger ( new CheckstyleReportPrinter ( $ reportOutput ) , $ errorOutput ) ; case 'txt' : case 'text' : return new VerboseConsoleLogger ( new ConsoleReportPrinter ( $ reportOutput ) , $ consoleOutput ) ; case 'compact' : return new CompactConsoleLogger ( new ConsoleReportPrinter ( $ reportOutput ) , $ consoleOutput ) ; default : throw new \ InvalidArgumentException ( 'Invalid report printer "' . $ outputFormat . '"!' ) ; } }
Builds a suitable logger for logging lint progress and results.

@param string          $outputFormat  The desired output format, as specified by the user, e.g. via command-line parameter
@param OutputInterface $reportOutput  Output stream for the result report (usually STDOUT or a file)
@param OutputInterface $consoleOutput Output stream for console data (usually STDOUT)
@return LinterLoggerInterface The printer matching the user's specifications.
Builds a suitable logger for logging lint progress and results .