Namespace PHPStan\Rules\RestrictedUsage

Classes
RestrictedClassConstantUsageRule
RestrictedFunctionCallableUsageRule
RestrictedFunctionUsageRule
RestrictedMethodCallableUsageRule
RestrictedMethodUsageRule
RestrictedPropertyUsageRule
RestrictedStaticMethodCallableUsageRule
RestrictedStaticMethodUsageRule
RestrictedStaticPropertyUsageRule
RestrictedUsage
Interfaces
RestrictedClassConstantUsageExtension

Extensions implementing this interface are called for each analysed class constant access. Extension can decide to create RestrictedUsage object with error message & error identifier to be reported for this class constant access. Typical usage is to report errors for constants marked as @-deprecated or @-internal. To register it in the configuration file use the following tag: ``` services: - class: App\PHPStan\MyExtension tags: - phpstan.restrictedClassConstantUsageExtension

RestrictedClassNameUsageExtension

Extensions implementing this interface are called for each analysed class name usage. Extension can decide to create RestrictedUsage object with error message & error identifier to be reported for this method call. Typical usage is to report errors for class names marked as @-deprecated or @-internal. Extension can take advantage of the usage location information in the ClassNameUsageLocation object. To register the extension in the configuration file use the following tag: ``` services: - class: App\PHPStan\MyExtension tags: - phpstan.restrictedClassNameUsageExtension

RestrictedFunctionUsageExtension

Extensions implementing this interface are called for each analysed function call. Extension can decide to create RestrictedUsage object with error message & error identifier to be reported for this function call. Typical usage is to report errors for functions marked as @-deprecated or @-internal. To register it in the configuration file use the following tag: ``` services: - class: App\PHPStan\MyExtension tags: - phpstan.restrictedFunctionUsageExtension

RestrictedMethodUsageExtension

Extensions implementing this interface are called for each analysed method call. Extension can decide to create RestrictedUsage object with error message & error identifier to be reported for this method call. Typical usage is to report errors for methods marked as @-deprecated or @-internal. To register it in the configuration file use the following tag: ``` services: - class: App\PHPStan\MyExtension tags: - phpstan.restrictedMethodUsageExtension

RestrictedPropertyUsageExtension

Extensions implementing this interface are called for each analysed property access. Extension can decide to create RestrictedUsage object with error message & error identifier to be reported for this property access. Typical usage is to report errors for properties marked as @-deprecated or @-internal. To register it in the configuration file use the following tag: ``` services: - class: App\PHPStan\MyExtension tags: - phpstan.restrictedPropertyUsageExtension