AbstractConstantFlagCheck
abstract class AbstractConstantFlagCheck extends AbstractClassCheck (View source)
Base class for checks that compare a single attribute (e.g. visibility) on class/interface/enum constants between reflection and stubs.
Iterates over stub constants that are available for the given PHP version, looks each one up in the reflection map (which includes all inherited constants), and delegates to {\StubTests\Framework\Validator\describeMismatch()} for the actual comparison. Constants that exist only in stubs but not in reflection are silently skipped — ClassConstantsCheck is responsible for reporting those.
Subclasses must implement:
- getCheckName(): the name used for known-problem lookups
- describeMismatch(): returns a failure message when the attribute differs, or null when it matches
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
Compare a single attribute on the reflection and stub constant.
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, string $checkName, 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 string
getCheckName()
No description
abstract protected string|null
describeMismatch(string $constantEntityId, PHPClassConstant $reflConstant, PHPClassConstant $stubConstant, string $phpVersion)
Compare a single attribute on the reflection and stub constant.
Return a descriptive failure message if there is a mismatch, or null if they match.
bool
supports(string $phpVersion)
No description
CheckResultSet
run(StubDataQueryInterface $stubs, string $entityId, string $phpVersion)
No description