PHP Class HippoPHP\Hippo\CheckResult

Inheritance: implements Countabl\Countable
Show file Open project: hippophp/hippo Class Usage Examples

Protected Properties

Property Type Description
$file File Which file is this check result for.
$violations Violation[] Violations held against the file.
$violationsDirty boolean Was modified since last violation retrieval?

Public Methods

Method Description
addViolation ( Violation $violation )
count ( ) : integer Counts how many violations are in the result.
getFile ( ) : File Returns which file is this check result for.
getMaximumViolationSeverity ( ) : integer | null
getViolations ( ) : Violation[] Return all of the violations on the file.
hasFailed ( ) : boolean Returns whether check failed.
hasSucceeded ( ) : boolean Returns whether check succeeded.
setFile ( File $file ) Sets which file is this check result for.

Private Methods

Method Description
processViolationsIfDirty ( ) Resorts the violations array if it's been changed.
sortViolations ( ) Sorts the violations by line then column.

Method Details

addViolation() public method

public addViolation ( Violation $violation )
$violation Violation

count() public method

Counts how many violations are in the result.
See also: Countable::count()
public count ( ) : integer
return integer

getFile() public method

Returns which file is this check result for.
public getFile ( ) : File
return File

getMaximumViolationSeverity() public method

getViolations() public method

Violations are sorted on a line/column basis.
public getViolations ( ) : Violation[]
return Violation[]

hasFailed() public method

Returns whether check failed.
public hasFailed ( ) : boolean
return boolean

hasSucceeded() public method

Returns whether check succeeded.
public hasSucceeded ( ) : boolean
return boolean

setFile() public method

Sets which file is this check result for.
public setFile ( File $file )
$file File

Property Details

$file protected property

Which file is this check result for.
protected File,HippoPHP\Hippo $file
return File

$violations protected property

Violations held against the file.
protected Violation[],HippoPHP\Hippo $violations
return Violation[]

$violationsDirty protected property

Was modified since last violation retrieval?
protected bool $violationsDirty
return boolean