Reporter
in package
Table of Contents
- $config : Config
- The config data for the run.
- $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.
- $totalFixed : int
- Total number of errors/warnings that were fixed.
- $totalWarnings : int
- Total number of warnings found during the run.
- $reports : array<string|int, mixed>
- A cache of report objects.
- $tmpFiles : array<string|int, mixed>
- A cache of opened temporary files.
- __construct() : void
- Initialise the reporter.
- cacheFileReport() : void
- Caches the result of a single processed file for all reports.
- prepareFileReport() : array<string|int, mixed>
- Generate summary information to be used during report generation.
- printReport() : void
- Generates and prints a single final report.
- printReports() : bool
- Generates and prints final versions of all reports.
Properties
$config
The config data for the run.
public
Config
$config
= null
$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
$totalFixed
Total number of errors/warnings that were fixed.
public
int
$totalFixed
= 0
$totalWarnings
Total number of warnings found during the run.
public
int
$totalWarnings
= 0
$reports
A cache of report objects.
private
array<string|int, mixed>
$reports
= []
$tmpFiles
A cache of opened temporary files.
private
array<string|int, mixed>
$tmpFiles
= []
Methods
__construct()
Initialise the reporter.
public
__construct(Config $config) : void
All reports specified in the config will be created and their output file (or a temp file if none is specified) initialised by clearing the current contents.
Parameters
- $config : Config
-
The config data for the run.
Tags
Return values
void —cacheFileReport()
Caches the result of a single processed file for all reports.
public
cacheFileReport(File $phpcsFile) : void
The report content that is generated is appended to the output file assigned to each report. This content may be an intermediate report format and not reflect the final report output.
Parameters
- $phpcsFile : File
-
The file that has been processed.
Return values
void —prepareFileReport()
Generate summary information to be used during report generation.
public
prepareFileReport(File $phpcsFile) : array<string|int, mixed>
Parameters
- $phpcsFile : File
-
The file that has been processed.
Return values
array<string|int, mixed> —printReport()
Generates and prints a single final report.
public
printReport(string $report) : void
Parameters
- $report : string
-
The report type to print.
Return values
void —printReports()
Generates and prints final versions of all reports.
public
printReports() : bool
Returns TRUE if any of the reports output content to the screen or FALSE if all reports were silently printed to a file.