diff --git a/src/Files/LocalFile.php b/src/Files/LocalFile.php index babfe69c31..c27070a5bd 100644 --- a/src/Files/LocalFile.php +++ b/src/Files/LocalFile.php @@ -112,9 +112,7 @@ public function process() $this->fixableCount = $cache['fixableCount']; } - if (PHP_CODESNIFFER_VERBOSITY > 0 - || (PHP_CODESNIFFER_CBF === true && empty($this->config->files) === false) - ) { + if (PHP_CODESNIFFER_VERBOSITY > 0) { echo "[loaded from cache]... "; } diff --git a/src/Fixer.php b/src/Fixer.php index b429825f06..40f7d81591 100644 --- a/src/Fixer.php +++ b/src/Fixer.php @@ -140,6 +140,11 @@ public function startFile(File $phpcsFile) */ public function fixFile() { + if ($this->currentFile === null) { + // This is a run with a cache, where we previously failed to fix the file. + return false; + } + $fixable = $this->currentFile->getFixableCount(); if ($fixable === 0) { // Nothing to fix. diff --git a/src/Runner.php b/src/Runner.php index b5afa71d05..b7dbab0e89 100644 --- a/src/Runner.php +++ b/src/Runner.php @@ -193,7 +193,6 @@ public function runPHPCBF() $this->config->generator = null; $this->config->explain = false; $this->config->interactive = false; - $this->config->cache = false; $this->config->showSources = false; $this->config->recordErrors = false; $this->config->reportFile = null;