class ProblemDefinition (View source)

Immutable value object representing a known validation problem.

Defines a specific entity (function/method/class) that has known issues with validation for documented reasons.

When $entityIds is non-empty it lists the specific sub-entity identifiers (e.g., individual constants like '\PDO::PGSQL_ASSOC') this problem covers. $entityId then serves as a grouping label (e.g., '\PDO'). When $entityIds is empty, $entityId is the single entity identifier.

Methods

__construct(EntityType $entityType, string $entityId, ProblemType $type, array $affectedChecks, PhpVersionRange $versionRange, string $reason, array $entityIds = [])

No description

bool
affects(CheckType $check, string $phpVersion)

Check if this problem affects a specific check for a given PHP version.

bool
appliesToVersion(string $phpVersion)

Check if this problem applies to a given PHP version.

Details

__construct(EntityType $entityType, string $entityId, ProblemType $type, array $affectedChecks, PhpVersionRange $versionRange, string $reason, array $entityIds = [])

No description

Parameters

EntityType $entityType

Type of entity (function, method, class, class_constant, …)

string $entityId

Fully qualified entity identifier, or a grouping label when $entityIds is non-empty

ProblemType $type

Category of problem

array $affectedChecks

List of validator checks that should skip this entity

PhpVersionRange $versionRange

PHP version range where this problem exists

string $reason

Human-readable explanation of why validation is skipped

array $entityIds

When non-empty, the problem applies to each ID in this list instead of $entityId

bool affects(CheckType $check, string $phpVersion)

Check if this problem affects a specific check for a given PHP version.

Parameters

CheckType $check

The validator check to test

string $phpVersion

PHP version (e.g., '8.0')

Return Value

bool

True if this problem affects the given check and version

bool appliesToVersion(string $phpVersion)

Check if this problem applies to a given PHP version.

Parameters

string $phpVersion

PHP version (e.g., '8.0')

Return Value

bool

True if problem exists in this PHP version