/** * This method will be called when the engine has finished the source * analysis phase. To remove file with violations from cache. * * @param Report $report * @return void */ public function renderReport(Report $report) { foreach ($report->getRuleViolations() as $violation) { $fileName = $violation->getFileName(); $this->cache->remove($fileName, null); } }
/** * Remove file from cache if contains errors * * @param array $report Prepared report data. * @param PHP_CodeSniffer_File $phpcsFile The file being reported on. * @param boolean $showSources Show sources? * @param int $width Maximum allowed line width. * * @return boolean */ public function generateFileReport($report, PHP_CodeSniffer_File $phpcsFile, $showSources = false, $width = 80) { if (!self::$cache || $report['errors'] === 0 && $report['warnings'] === 0) { // Nothing to do return false; } self::$cache->remove($report['filename']); return false; }