Example #1
0
 /**
  * Generate a partial report for a single processed file.
  *
  * Function should return TRUE if it printed or stored data about the file
  * and FALSE if it ignored the file. Returning TRUE indicates that the file and
  * its data should be counted in the grand totals.
  *
  * @param array                 $report      Prepared report data.
  * @param \PHP_CodeSniffer\File $phpcsFile   The file being reported on.
  * @param bool                  $showSources Show sources?
  * @param int                   $width       Maximum allowed line width.
  *
  * @return bool
  */
 public function generateFileReport($report, File $phpcsFile, $showSources = false, $width = 80)
 {
     $metrics = $phpcsFile->getMetrics();
     foreach ($metrics as $metric => $data) {
         foreach ($data['values'] as $value => $count) {
             echo "{$metric}>>{$value}>>{$count}" . PHP_EOL;
         }
     }
     return true;
 }