class DiagnosticSelection

Properties

protected list<string> $only

The normalized selectors diagnostics must match.

protected list<string> $except

The normalized selectors diagnostics must not match.

protected list<list<string>> $onlyConstraints

The normalized only constraints that must all match.

Methods

__construct(iterable $only = [], iterable $except = [], array $onlyConstraints = [])

Create a new diagnostic selection instance.

make(iterable $only = [], iterable $except = [])

Create a new normalized diagnostic selection.

constrain(iterable $only = [], iterable $except = [])

Add another selection constraint.

bool
matches(Diagnostic $diagnostic)

Determine whether a diagnostic matches the selection.

static array
normalize(iterable $values)

Normalize selection values.

bool
matchesAny(array $criteria, Diagnostic $diagnostic)

Determine whether any criterion matches the diagnostic.

bool
matchesCriterion(string $criterion, Diagnostic $diagnostic)

Determine whether a criterion matches the diagnostic.

bool
matchesPackage(string $criterion, Diagnostic $diagnostic)

Determine whether a criterion matches the diagnostic's package.

Details

at line 37
__construct(iterable $only = [], iterable $except = [], array $onlyConstraints = [])

Create a new diagnostic selection instance.

Parameters

iterable $only
iterable $except
array $onlyConstraints

at line 68
static DiagnosticSelection make(iterable $only = [], iterable $except = [])

Create a new normalized diagnostic selection.

Parameters

iterable $only
iterable $except

Return Value

DiagnosticSelection

at line 79
DiagnosticSelection constrain(iterable $only = [], iterable $except = [])

Add another selection constraint.

Parameters

iterable $only
iterable $except

Return Value

DiagnosticSelection

at line 97
bool matches(Diagnostic $diagnostic)

Determine whether a diagnostic matches the selection.

Parameters

Diagnostic $diagnostic

Return Value

bool

at line 118
static protected array normalize(iterable $values)

Normalize selection values.

Parameters

iterable $values

Return Value

array

at line 133
protected bool matchesAny(array $criteria, Diagnostic $diagnostic)

Determine whether any criterion matches the diagnostic.

Parameters

array $criteria
Diagnostic $diagnostic

Return Value

bool

at line 147
protected bool matchesCriterion(string $criterion, Diagnostic $diagnostic)

Determine whether a criterion matches the diagnostic.

Parameters

string $criterion
Diagnostic $diagnostic

Return Value

bool

at line 158
protected bool matchesPackage(string $criterion, Diagnostic $diagnostic)

Determine whether a criterion matches the diagnostic's package.

Parameters

string $criterion
Diagnostic $diagnostic

Return Value

bool