PHP Class pchLintCheck, php-commit-hooks

Implements linter checks for all added or modified files.
Inheritance: extends pchCheck
Show file Open project: kore/php-commit-hooks Class Usage Examples

Protected Properties

Property Type Description
$linters array Configured linters to check source files for validity

Public Methods

Method Description
__construct ( array $linters = null ) : void Construct from linter configuration
lint ( pchRepository $repository, string $file ) : array Lint single file
validate ( pchRepository $repository ) : void Validate the current check

Method Details

__construct() public method

Construct from linter configuration
public __construct ( array $linters = null ) : void
$linters array
return void

lint() public method

If issues with the passed file are found the function will return an array with the found issues, and an empty array otherwise.
public lint ( pchRepository $repository, string $file ) : array
$repository pchRepository
$file string
return array

validate() public method

Validate the check on the specified repository. Returns an array of found issues.
public validate ( pchRepository $repository ) : void
$repository pchRepository
return void

Property Details

$linters protected property

Configured linters to check source files for validity
protected array $linters
return array