Runner
in package
Table of Contents
- $config : Config
- The config data for the run.
- $reporter : Reporter
- The reporter used for generating reports after the run.
- $ruleset : Ruleset
- The ruleset used for the run.
- checkRequirements() : void
- Exits if the minimum requirements of PHP_CodeSniffer are not met.
- handleErrors() : void
- Converts all PHP errors into exceptions.
- init() : void
- Init the rulesets and other high-level settings.
- printProgress() : void
- Print progress information for a single processed file.
- processFile() : void
- Processes a single file, including checking and fixing.
- runPHPCBF() : array<string|int, mixed>
- Run the PHPCBF script.
- runPHPCS() : array<string|int, mixed>
- Run the PHPCS script.
- processChildProcs() : bool
- Waits for child processes to complete and cleans up after them.
- run() : int
- Performs the run.
Properties
$config
The config data for the run.
public
Config
$config
= null
$reporter
The reporter used for generating reports after the run.
public
Reporter
$reporter
= null
$ruleset
The ruleset used for the run.
public
Ruleset
$ruleset
= null
Methods
checkRequirements()
Exits if the minimum requirements of PHP_CodeSniffer are not met.
public
checkRequirements() : void
Tags
Return values
void —handleErrors()
Converts all PHP errors into exceptions.
public
handleErrors(int $code, string $message, string $file, int $line) : void
This method forces a sniff to stop processing if it is not able to handle a specific piece of code, instead of continuing and potentially getting into a loop.
Parameters
- $code : int
-
The level of error raised.
- $message : string
-
The error message.
- $file : string
-
The path of the file that raised the error.
- $line : int
-
The line number the error was raised at.
Tags
Return values
void —init()
Init the rulesets and other high-level settings.
public
init() : void
Tags
Return values
void —printProgress()
Print progress information for a single processed file.
public
printProgress(File $file, int $numFiles, int $numProcessed) : void
Parameters
- $file : File
-
The file that was processed.
- $numFiles : int
-
The total number of files to process.
- $numProcessed : int
-
The number of files that have been processed, including this one.
Return values
void —processFile()
Processes a single file, including checking and fixing.
public
processFile(File $file) : void
Parameters
- $file : File
-
The file to be processed.
Tags
Return values
void —runPHPCBF()
Run the PHPCBF script.
public
runPHPCBF() : array<string|int, mixed>
Return values
array<string|int, mixed> —runPHPCS()
Run the PHPCS script.
public
runPHPCS() : array<string|int, mixed>
Return values
array<string|int, mixed> —processChildProcs()
Waits for child processes to complete and cleans up after them.
private
processChildProcs(array<string|int, mixed> $childProcs) : bool
The reporting information returned by each child process is merged into the main reporter class.
Parameters
- $childProcs : array<string|int, mixed>
-
An array of child processes to wait for.
Return values
bool —run()
Performs the run.
private
run() : int
Tags
Return values
int —The number of errors and warnings found.