MemberKindTest
class MemberKindTest extends TestCase (View source)
The member-kind configuration that used to be six one-line abstract hooks spread across AbstractMethodFlagCheck and AbstractPropertyFlagCheck. Now that it is data rather than inheritance, it can be asserted directly instead of only through the 16 leaf checks.
Methods
No description
Properties carry the $ sigil, matching how known-problem definitions are written.
No description
The two kinds must never collide in known-problem lookups.
No description
No description
Properties are class-only in the model: PHPEnum and PHPInterface have no getProperties(), so the property kind must yield nothing for them rather than erroring. This guard used to live in AbstractPropertyFlagCheck::collectReflectionMembers().
Enums and interfaces do have methods, so the method kind still reads them.
Every case must answer every accessor. Guards against a third kind being added with only some of the three matches extended — each would otherwise throw UnhandledMatchError at runtime, in a check, rather than here.
Details
testMethodIdsUseThePlainScopeResolutionSeparator()
No description
testPropertyIdsCarryTheDollarSigil()
Properties carry the $ sigil, matching how known-problem definitions are written.
testKnownProblemEntityTypesMatchTheEntityTypeEnum()
No description
testTheTwoKindsUseDistinctEntityTypes()
The two kinds must never collide in known-problem lookups.
testMethodKindReadsMethodsFromTheEntity()
No description
testPropertyKindReadsPropertiesFromAClass()
No description
testPropertyKindYieldsNothingForNonClassEntities()
Properties are class-only in the model: PHPEnum and PHPInterface have no getProperties(), so the property kind must yield nothing for them rather than erroring. This guard used to live in AbstractPropertyFlagCheck::collectReflectionMembers().
testMethodKindWorksForEnumsAndInterfaces()
Enums and interfaces do have methods, so the method kind still reads them.
testEveryCaseAnswersEveryAccessor()
Every case must answer every accessor. Guards against a third kind being added with only some of the three matches extended — each would otherwise throw UnhandledMatchError at runtime, in a check, rather than here.