PHP_CodeSniffer_Reports_Hgblame
extends PHP_CodeSniffer_Reports_VersionControl
in package
Mercurial report for PHP_CodeSniffer.
PHP version 5
Tags
Table of Contents
- $reportName : string
- The name of the report we want in the output
- $_authorCache : array<string|int, mixed>
- A cache of author stats collected during the run.
- $_praiseCache : array<string|int, mixed>
- A cache of blame stats collected during the run.
- $_sourceCache : array<string|int, mixed>
- A cache of source stats collected during the run.
- generate() : void
- Prints the author of all errors and warnings, as given by "version control blame".
- generateFileReport() : bool
- Generate a partial report for a single processed file.
- getAuthor() : mixed
- Extract the author from a blame line.
- getBlameContent() : array<string|int, mixed>
- Gets the blame output.
Properties
$reportName
The name of the report we want in the output
protected
string
$reportName
= 'MERCURIAL'
$_authorCache
A cache of author stats collected during the run.
private
array<string|int, mixed>
$_authorCache
= array()
$_praiseCache
A cache of blame stats collected during the run.
private
array<string|int, mixed>
$_praiseCache
= array()
$_sourceCache
A cache of source stats collected during the run.
private
array<string|int, mixed>
$_sourceCache
= array()
Methods
generate()
Prints the author of all errors and warnings, as given by "version control blame".
public
generate(string $cachedData, int $totalFiles, int $totalErrors, int $totalWarnings, int $totalFixable[, bool $showSources = false ][, int $width = 80 ][, 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.
- $toScreen : bool = true
-
Is the report being printed to screen?
Return values
void —generateFileReport()
Generate a partial report for a single processed file.
public
generateFileReport(array<string|int, mixed> $report, PHP_CodeSniffer_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.
Parameters
- $report : array<string|int, mixed>
-
Prepared report data.
- $phpcsFile : PHP_CodeSniffer_File
-
The file being reported on.
- $showSources : bool = false
-
Show sources?
- $width : int = 80
-
Maximum allowed line width.
Return values
bool —getAuthor()
Extract the author from a blame line.
protected
getAuthor(string $line) : mixed
Parameters
- $line : string
-
Line to parse.
Return values
mixed —string or false if impossible to recover.
getBlameContent()
Gets the blame output.
protected
getBlameContent(string $filename) : array<string|int, mixed>
Parameters
- $filename : string
-
File to blame.