diff --git a/src/Reports/Cbf.php b/src/Reports/Cbf.php index 21662e7d1e..52073dfd2f 100644 --- a/src/Reports/Cbf.php +++ b/src/Reports/Cbf.php @@ -15,7 +15,6 @@ use PHP_CodeSniffer\Exceptions\DeepExitException; use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util\Timing; use PHP_CodeSniffer\Util\Writers\StatusWriter; class Cbf implements Report @@ -254,10 +253,6 @@ public function generate( echo PHP_EOL.str_repeat('-', $width).PHP_EOL.PHP_EOL; - if ($toScreen === true && $interactive === false) { - Timing::printRunTime(); - } - }//end generate() diff --git a/src/Reports/Code.php b/src/Reports/Code.php index 20dda6faef..1a39f06f92 100644 --- a/src/Reports/Code.php +++ b/src/Reports/Code.php @@ -12,7 +12,6 @@ use Exception; use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Util\Common; -use PHP_CodeSniffer\Util\Timing; use PHP_CodeSniffer\Util\Writers\StatusWriter; class Code implements Report @@ -358,10 +357,6 @@ public function generate( echo $cachedData; - if ($toScreen === true && $interactive === false) { - Timing::printRunTime(); - } - }//end generate() diff --git a/src/Reports/Full.php b/src/Reports/Full.php index 9af4efaeab..62e4503b06 100644 --- a/src/Reports/Full.php +++ b/src/Reports/Full.php @@ -10,7 +10,6 @@ namespace PHP_CodeSniffer\Reports; use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util\Timing; class Full implements Report { @@ -250,10 +249,6 @@ public function generate( echo $cachedData; - if ($toScreen === true && $interactive === false) { - Timing::printRunTime(); - } - }//end generate() diff --git a/src/Reports/Info.php b/src/Reports/Info.php index 9f1f45aa57..f12f48250c 100644 --- a/src/Reports/Info.php +++ b/src/Reports/Info.php @@ -10,7 +10,6 @@ namespace PHP_CodeSniffer\Reports; use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util\Timing; class Info implements Report { @@ -163,10 +162,6 @@ public function generate( echo str_repeat('-', 70).PHP_EOL; - if ($toScreen === true && $interactive === false) { - Timing::printRunTime(); - } - }//end generate() diff --git a/src/Reports/Source.php b/src/Reports/Source.php index deedb3ebd0..405dd814a1 100644 --- a/src/Reports/Source.php +++ b/src/Reports/Source.php @@ -10,7 +10,6 @@ namespace PHP_CodeSniffer\Reports; use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util\Timing; class Source implements Report { @@ -266,10 +265,6 @@ public function generate( echo PHP_EOL.str_repeat('-', $width).PHP_EOL.PHP_EOL; - if ($toScreen === true && $interactive === false) { - Timing::printRunTime(); - } - }//end generate() diff --git a/src/Reports/Summary.php b/src/Reports/Summary.php index 165ad64b0c..14692cfeda 100644 --- a/src/Reports/Summary.php +++ b/src/Reports/Summary.php @@ -10,7 +10,6 @@ namespace PHP_CodeSniffer\Reports; use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util\Timing; class Summary implements Report { @@ -174,10 +173,6 @@ function ($keyA, $keyB) { echo PHP_EOL.str_repeat('-', $width).PHP_EOL.PHP_EOL; - if ($toScreen === true && $interactive === false) { - Timing::printRunTime(); - } - }//end generate() diff --git a/src/Reports/VersionControl.php b/src/Reports/VersionControl.php index 296846c7d7..c76fb6d460 100644 --- a/src/Reports/VersionControl.php +++ b/src/Reports/VersionControl.php @@ -11,7 +11,6 @@ namespace PHP_CodeSniffer\Reports; use PHP_CodeSniffer\Files\File; -use PHP_CodeSniffer\Util\Timing; abstract class VersionControl implements Report { @@ -347,10 +346,6 @@ public function generate( echo PHP_EOL.str_repeat('-', $width).PHP_EOL.PHP_EOL; - if ($toScreen === true && $interactive === false) { - Timing::printRunTime(); - } - }//end generate() diff --git a/src/Runner.php b/src/Runner.php index 580a8f408b..23bc4d90bc 100644 --- a/src/Runner.php +++ b/src/Runner.php @@ -120,17 +120,9 @@ public function runPHPCS() $numErrors = $this->run(); // Print all the reports for this run. - $toScreen = $this->reporter->printReports(); - - // Only print timer output if no reports were - // printed to the screen so we don't put additional output - // in something like an XML report. If we are printing to screen, - // the report types would have already worked out who should - // print the timer info. - if ($this->config->interactive === false - && ($toScreen === false - || (($this->reporter->totalErrors + $this->reporter->totalWarnings) === 0 && $this->config->showProgress === true)) - ) { + $this->reporter->printReports(); + + if ($this->config->quiet === false) { Timing::printRunTime(); } } catch (DeepExitException $e) { @@ -215,8 +207,10 @@ public function runPHPCBF() $this->run(); $this->reporter->printReports(); - echo PHP_EOL; - Timing::printRunTime(); + if ($this->config->quiet === false) { + StatusWriter::write(''); + Timing::printRunTime(); + } } catch (DeepExitException $e) { echo $e->getMessage(); return $e->getCode();