Interface PHPStan\Reflection\AllowedSubTypesClassReflectionExtension

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

  • PHPStan\Reflection\AllowedSubTypesClassReflectionExtension
    • PHPStan\Reflection\Php\EnumAllowedSubTypesClassReflectionExtension implements AllowedSubTypesClassReflectionExtension
Methods