This is the extension interface to implement if you want to described allowed subtypes - to limit which classes can implement a certain interface or extend a certain parent class.
To register it in the configuration file use the phpstan.broker.allowedSubTypesClassReflectionExtension
service tag:
services:
-
class: App\PHPStan\MyExtension
tags:
- phpstan.broker.allowedSubTypesClassReflectionExtension
Learn more: https://phpstan.org/developing-extensions/allowed-subtypes
Methods | ||
---|---|---|
public
|
supports(ClassReflection $classReflection): bool
|
# |
public
|
getAllowedSubTypes(ClassReflection $classReflection): array<Type>
|
# |