Documentation

Report

Table of Contents

Methods

generate()  : void
Generate the actual report.
generateFileReport()  : bool
Generate a partial report for a single processed file.

Methods

generate()

Generate the actual report.

public generate(string $cachedData, int $totalFiles, int $totalErrors, int $totalWarnings, int $totalFixable[, bool $showSources = false ][, int $width = 80 ][, bool $interactive = false ][, bool $toScreen = true ]) : void
Parameters
$cachedData : string

Any partial report data that was returned from generateFileReport during the run.

$totalFiles : int

Total number of files processed during the run.

$totalErrors : int

Total number of errors found during the run.

$totalWarnings : int

Total number of warnings found during the run.

$totalFixable : int

Total number of problems that can be fixed.

$showSources : bool = false

Show sources?

$width : int = 80

Maximum allowed line width.

$interactive : bool = false

Are we running in interactive mode?

$toScreen : bool = true

Is the report being printed to screen?

generateFileReport()

Generate a partial report for a single processed file.

public generateFileReport(array<string, string|int|array<string|int, mixed>> $report, File $phpcsFile[, bool $showSources = false ][, int $width = 80 ]) : bool

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.

The format of the $report parameter the function receives is as follows:

array(
  'filename' => string The name of the current file.
  'errors'   => int    The number of errors seen in the current file.
  'warnings' => int    The number of warnings seen in the current file.
  'fixable'  => int    The number of fixable issues seen in the current file.
  'messages' => array(
    int <Line number> => array(
      int <Column number> => array(
        int <Message index> => array(
          'message'  => string The error/warning message.
          'source'   => string The full error code for the message.
          'severity' => int    The severity of the message.
          'fixable'  => bool   Whether this error/warning is auto-fixable.
          'type'     => string The type of message. Either 'ERROR' or 'WARNING'.
        )
      )
    )
  )
)
Parameters
$report : array<string, string|int|array<string|int, mixed>>

Prepared report data.

$phpcsFile : File

The file being reported on.

$showSources : bool = false

Show sources?

$width : int = 80

Maximum allowed line width.

Return values
bool

        
On this page

Search results