ClassStaticPropertiesCheck
class ClassStaticPropertiesCheck extends AbstractPropertyFlagCheck (View source)
Validates that the static modifier on properties in stubs matches reflection.
For each class identified by $entityId the validator:
- Iterates all properties reported by reflection for the class.
- Looks up each property in the version-filtered stub hierarchy (parent classes), collecting a name → PHPProperty map with child-wins-over-parent priority.
- If the stub property is not found it is silently skipped — existence is ClassPropertiesExistCheck's responsibility.
- When both sides are found, their isStatic flags are compared and any mismatch is reported as a failure.
Known problems are supported at two granularities:
- class-level: EntityType::CLASS_TYPE + classId + 'ClassStaticPropertiesCheck' → skips all static-property checks for the class.
- property-level: EntityType::PROPERTY + '\ClassName::$propertyName' + 'ClassStaticPropertiesCheck' → skips only that specific mismatch.
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 flag on the reflection and stub property.
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
protected string
getCheckName()
No description
protected string|null
describeMismatch(string $propertyEntityId, PHPProperty $reflProperty, PHPProperty $stubProperty, string $phpVersion)
Compare a flag on the reflection and stub property.
Return a descriptive failure message if there is a mismatch, or null if they match.
protected PHPClass|null
findEntity(StubDataQueryInterface $storage, string $entityId)
No description
bool
supports(string $phpVersion)
No description
CheckResultSet
run(StubDataQueryInterface $stubs, string $entityId, string $phpVersion)
No description