PHP_CodeSniffer_Reporting
in package
A class to manage reporting.
Tags
Table of Contents
- $startTime : float
- When the PHPCS run started.
- $totalErrors : int
- Total number of errors found during the run.
- $totalFiles : int
- Total number of files that contain errors or warnings.
- $totalFixable : int
- Total number of errors/warnings that can be fixed.
- $totalWarnings : int
- Total number of warnings found during the run.
- $_cachedReports : array<string|int, mixed>
- A list of reports that have written partial report output.
- $_reports : array<string|int, mixed>
- A cache of report objects.
- $_tmpFiles : array<string|int, mixed>
- A cache of opened tmp files.
- cacheFileReport() : void
- Actually generates the report.
- factory() : PHP_CodeSniffer_Report
- Produce the appropriate report object based on $type parameter.
- prepareFileReport() : array<string|int, mixed>
- Pre-process and package violations for all files.
- printReport() : array<string|int, int>
- Generates and prints a final report.
- printRunTime() : void
- Print information about the run.
- startTiming() : void
- Start recording time for the run.
Properties
$startTime
When the PHPCS run started.
public
static float
$startTime
= 0
$totalErrors
Total number of errors found during the run.
public
int
$totalErrors
= 0
$totalFiles
Total number of files that contain errors or warnings.
public
int
$totalFiles
= 0
$totalFixable
Total number of errors/warnings that can be fixed.
public
int
$totalFixable
= 0
$totalWarnings
Total number of warnings found during the run.
public
int
$totalWarnings
= 0
$_cachedReports
A list of reports that have written partial report output.
private
array<string|int, mixed>
$_cachedReports
= array()
$_reports
A cache of report objects.
private
array<string|int, mixed>
$_reports
= array()
$_tmpFiles
A cache of opened tmp files.
private
array<string|int, mixed>
$_tmpFiles
= array()
Methods
cacheFileReport()
Actually generates the report.
public
cacheFileReport(PHP_CodeSniffer_File $phpcsFile, array<string|int, mixed> $cliValues) : void
Parameters
- $phpcsFile : PHP_CodeSniffer_File
-
The file that has been processed.
- $cliValues : array<string|int, mixed>
-
An array of command line arguments.
Return values
void —factory()
Produce the appropriate report object based on $type parameter.
public
factory(string $type) : PHP_CodeSniffer_Report
Parameters
- $type : string
-
The type of the report.
Tags
Return values
PHP_CodeSniffer_Report —prepareFileReport()
Pre-process and package violations for all files.
public
prepareFileReport(PHP_CodeSniffer_File $phpcsFile) : array<string|int, mixed>
Used by error reports to get a packaged list of all errors in each file.
Parameters
- $phpcsFile : PHP_CodeSniffer_File
-
The file that has been processed.
Return values
array<string|int, mixed> —printReport()
Generates and prints a final report.
public
printReport(string $report, bool $showSources, array<string|int, mixed> $cliValues[, string $reportFile = '' ][, int $reportWidth = 80 ]) : array<string|int, int>
Returns an array with the number of errors and the number of warnings, in the form ['errors' => int, 'warnings' => int].
Parameters
- $report : string
-
Report type.
- $showSources : bool
-
Show sources?
- $cliValues : array<string|int, mixed>
-
An array of command line arguments.
- $reportFile : string = ''
-
Report file to generate.
- $reportWidth : int = 80
-
Report max width.
Return values
array<string|int, int> —printRunTime()
Print information about the run.
public
static printRunTime() : void
Return values
void —startTiming()
Start recording time for the run.
public
static startTiming() : void