From 2363775e3426c7955e863bcafaf16f6d8954bb94 Mon Sep 17 00:00:00 2001 From: Dan Cryer Date: Wed, 30 Apr 2014 14:15:25 +0100 Subject: [PATCH] Adding PHPCS report parsing. --- PHPCI/Plugin/PhpCodeSniffer.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PHPCI/Plugin/PhpCodeSniffer.php b/PHPCI/Plugin/PhpCodeSniffer.php index fe19fa0a..c88c422b 100755 --- a/PHPCI/Plugin/PhpCodeSniffer.php +++ b/PHPCI/Plugin/PhpCodeSniffer.php @@ -151,6 +151,8 @@ class PhpCodeSniffer implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin return false; } + $this->phpci->logExecOutput(false); + $cmd = $phpcs . ' --report=json %s %s %s %s %s "%s"'; $this->phpci->executeCommand( $cmd, @@ -165,6 +167,8 @@ class PhpCodeSniffer implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin $output = $this->phpci->getLastOutput(); list($errors, $warnings, $data) = $this->processReport(json_decode(trim($output), true)); + $this->phpci->logExecOutput(true); + $success = true; $this->build->storeMeta('phpcs-warnings', $warnings); $this->build->storeMeta('phpcs-errors', $errors);