AbstractMemberFlagCheck
abstract class AbstractMemberFlagCheck extends AbstractClassCheck (View source)
Shared orchestration for checks that compare a per-member attribute (e.g. a method's isStatic flag or a property's visibility) between reflection and stubs.
The comparison is reflection-driven: it iterates the reflection members and compares each one that also exists in the version-filtered stub member map. Members present only in reflection (or only in stubs) are ignored here — reporting those is the responsibility of the corresponding *ExistCheck.
Concrete member kinds (methods, properties) supply the member-specific behaviour via the hooks below. Constants are NOT modelled here: {\StubTests\Framework\Validator\AbstractConstantFlagCheck} iterates the stub side with per-member version filtering and different known-problem-skip semantics.
Subclasses must supply three things, one per axis plus the check's identity:
- getCheckName(): the name used for known-problem lookups
- memberKind(): which member kind to compare (see {\StubTests\Framework\Validator\Contracts\MemberKind})
- one of {\StubTests\Framework\Validator\Contracts\DescribesMethodMismatch} / {\StubTests\Framework\Validator\Contracts\DescribesPropertyMismatch}: the comparison itself
Those last two are the two axes this check varies along. They used to be expressed as one inheritance chain — a member-kind subclass per kind, with the comparison abstract below it — so adding a member kind meant adding a level. Now the kind is data and the comparison is an interface, and neither requires a new abstract class.
Constants
| private FUNCTION_LOOKUP_UNSUPPORTED |
|
| private NO_DESCRIBER |
|
Properties
| protected ReflectionProviderInterface | $reflectionProvider | from AbstractReflectionCheck | |
| protected KnownProblemsRegistry | $knownProblemsRegistry | from AbstractReflectionCheck | |
| protected EntityLookupService | $entityLookup | from AbstractClassCheck | |
| protected MethodCollectionService | $methodCollection | from AbstractClassCheck | |
| protected EntityTypeConfig|null | $entityTypeConfig | from AbstractClassCheck |
Methods
No description
Records a skipped-success result if a known problem covers this entity, and returns true.
Look up an entity by ID, dispatching to the right lookup method based on config.
Collect version-filtered methods, dispatching based on config.
Collect version-filtered properties, dispatching based on config.
No description
Which member kind this check compares. Supplies the id format, the known-problem entity type and the reflection-member accessor, all of which used to be one-line abstract hooks.
No description
Details
__construct(ReflectionProviderInterface|null $reflectionProvider = null, KnownProblemsRegistry|null $knownProblemsRegistry = null, EntityLookupService|null $entityLookup = null, MethodCollectionService|null $methodCollection = null, EntityTypeConfig|null $entityTypeConfig = null)
No description
protected bool
skipWithKnownProblem(CheckResultSet $results, string $entityType, string $entityId, CheckType $checkType, string $phpVersion)
Records a skipped-success result if a known problem covers this entity, and returns true.
Returns false if validation should proceed normally.
protected PHPClassLikeObject|null
lookupEntityById(StubDataQueryInterface $storage, string $entityId)
Look up an entity by ID, dispatching to the right lookup method based on config.
Defaults to class lookup when no config is set.
protected array
collectEntityMethodsByConfig(PHPClassLikeObject $entity, string $phpVersion)
Collect version-filtered methods, dispatching based on config.
Defaults to class hierarchy traversal when no config is set.
protected array
collectEntityPropertiesByConfig(PHPClassLikeObject $entity, string $phpVersion)
Collect version-filtered properties, dispatching based on config.
Only classes have properties; returns empty array for enum/interface.
protected string
getEntityLabel()
No description
protected string
getEntityType()
No description
protected string
getConstantEntityType()
No description
protected PHPClass|null
findClassById(StubDataQueryInterface $storage, string $entityId)
No description
protected PHPEnum|null
findEnumById(StubDataQueryInterface $storage, string $entityId)
No description
protected PHPInterface|null
findInterfaceById(StubDataQueryInterface $storage, string $entityId)
No description
abstract protected CheckType
getCheckName()
No description
abstract protected MemberKind
memberKind()
Which member kind this check compares. Supplies the id format, the known-problem entity type and the reflection-member accessor, all of which used to be one-line abstract hooks.
bool
supports(string $phpVersion)
No description
CheckResultSet
run(StubDataQueryInterface $stubs, string $entityId, string $phpVersion)
No description