Skip to content

Commit fee9f33

Browse files
committed
Colors in cacheFileReport cannot be switched of
I am using ``` vendor/bin/phpcs --report="diff" --extensions="php" --no-colors --report-diff=var/phpcs_report_680bb28374ffe.diff ``` to see some progress. In this case, it was not possible to switch of colors in the diff file.
1 parent 23feb19 commit fee9f33

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Reporter.php

+4
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,10 @@ public function cacheFileReport(File $phpcsFile)
290290
$generatedReport = ob_get_contents();
291291
ob_end_clean();
292292

293+
if ($this->config->colors !== true) {
294+
$generatedReport = Common::stripColors($generatedReport);
295+
}
296+
293297
if ($report['output'] === null) {
294298
// Using a temp file.
295299
if (isset($this->tmpFiles[$type]) === false) {

0 commit comments

Comments
 (0)