classes/phing/tasks/ext/PhpCodeSnifferTask.php
protected function printErrorReport($phpcs)
    {
        $sniffs = $phpcs->getSniffs();
        $sniffStr = '';
        foreach ($sniffs as $sniff) {
            if (is_string($sniff)) {
                $sniffStr .= '- ' . $sniff . PHP_EOL;
            } else {
                $sniffStr .= '- ' . get_class($sniff) . PHP_EOL;
            }
        }
        $this->project->setProperty($this->getPropertyName(), (string) $sniffStr);

        if ($this->showSniffs) {
            $this->log('The list of used sniffs (#' . count($sniffs) . '): ' . PHP_EOL . $sniffStr, Project::MSG_INFO);
        }

        // process output
        $reporting = $phpcs->reporting;
        foreach ($this->formatters as $fe) {
            $reportFile = null;

            if ($fe->getUseFile()) {
                $reportFile = $fe->getOutfile();
                //ob_start();
            }

            // Crude check, but they broke backwards compatibility
            // with a minor version release.
            if (PHP_CodeSniffer::VERSION >= '2.2.0') {
                $cliValues = ['colors' => false];
                $reporting->printReport(
                    $fe->getType(),
                    $this->showSources,
                    $cliValues,
                    $reportFile,
                    $this->reportWidth
                );
            } else {
                $reporting->printReport(
                    $fe->getType(),
                    $this->showSources,
                    $reportFile,
                    $this->reportWidth
                );
            }

            // reporting class uses ob_end_flush(), but we don't want
            // an output if we use a file
            if ($fe->getUseFile()) {
                //ob_end_clean();
            }
        }
    }
protected function printErrorReport($phpcs)
    {
        $sniffs = $phpcs->getSniffs();
        $sniffStr = '';
        foreach ($sniffs as $sniff) {
            if (is_string($sniff)) {
                $sniffStr .= '- ' . $sniff . PHP_EOL;
            } else {
                $sniffStr .= '- ' . get_class($sniff) . PHP_EOL;
            }
        }
        $this->project->setProperty($this->getPropertyName(), (string) $sniffStr);

        if ($this->showSniffs) {
            $this->log('The list of used sniffs (#' . count($sniffs) . '): ' . PHP_EOL . $sniffStr, Project::MSG_INFO);
        }

        // process output
        $reporting = $phpcs->reporting;
        foreach ($this->formatters as $fe) {
            $reportFile = null;

            if ($fe->getUseFile()) {
                $reportFile = $fe->getOutfile();
                //ob_start();
            }

            // Crude check, but they broke backwards compatibility
            // with a minor version release.
            if (PHP_CodeSniffer::VERSION >= '2.2.0') {
                $cliValues = ['colors' => false];
                $reporting->printReport(
                    $fe->getType(),
                    $this->showSources,
                    $cliValues,
                    $reportFile,
                    $this->reportWidth
                );
            } else {
                $reporting->printReport(
                    $fe->getType(),
                    $this->showSources,
                    $reportFile,
                    $this->reportWidth
                );
            }

            // reporting class uses ob_end_flush(), but we don't want
            // an output if we use a file
            if ($fe->getUseFile()) {
                //ob_end_clean();
            }
        }
    }
protected function printErrorReport ( $ phpcs ) { $ sniffs = $ phpcs -> getSniffs ( ) ; $ sniffStr = '' ; foreach ( $ sniffs as $ sniff ) { if ( is_string ( $ sniff ) ) { $ sniffStr .= '- ' . $ sniff . PHP_EOL ; } else { $ sniffStr .= '- ' . get_class ( $ sniff ) . PHP_EOL ; } } $ this -> project -> setProperty ( $ this -> getPropertyName ( ) , ( string ) $ sniffStr ) ; if ( $ this -> showSniffs ) { $ this -> log ( 'The list of used sniffs (#' . count ( $ sniffs ) . '): ' . PHP_EOL . $ sniffStr , Project :: MSG_INFO ) ; } // process output $ reporting = $ phpcs -> reporting ; foreach ( $ this -> formatters as $ fe ) { $ reportFile = null ; if ( $ fe -> getUseFile ( ) ) { $ reportFile = $ fe -> getOutfile ( ) ; //ob_start(); } // Crude check, but they broke backwards compatibility // with a minor version release. if ( PHP_CodeSniffer :: VERSION >= '2.2.0' ) { $ cliValues = [ 'colors' => false ] ; $ reporting -> printReport ( $ fe -> getType ( ) , $ this -> showSources , $ cliValues , $ reportFile , $ this -> reportWidth ) ; } else { $ reporting -> printReport ( $ fe -> getType ( ) , $ this -> showSources , $ reportFile , $ this -> reportWidth ) ; } // reporting class uses ob_end_flush(), but we don't want // an output if we use a file if ( $ fe -> getUseFile ( ) ) { //ob_end_clean(); } } }
Prints the error report.

@param PHP_CodeSniffer $phpcs The PHP_CodeSniffer object containing
the errors.
Prints the error report .