1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\Classes;
4:
5: use PHPStan\DependencyInjection\ExtensionInterface;
6:
7: /**
8: * This is the extension interface to implement if you want to dynamically
9: * add forbidden class prefixes to the ClassForbiddenNameCheck rule.
10: *
11: * The idea is that you want to report usages of classes that you're not supposed to use in application.
12: * For example: Generated Doctrine proxies from their configured namespace.
13: *
14: * To register it in the configuration file use the `phpstan.forbiddenClassNamesExtension` service tag:
15: *
16: * ```
17: * services:
18: * -
19: * class: App\PHPStan\MyExtension
20: * tags:
21: * - phpstan.forbiddenClassNamesExtension
22: * ```
23: *
24: * @api
25: */
26: #[ExtensionInterface(tag: self::EXTENSION_TAG)]
27: interface ForbiddenClassNameExtension
28: {
29:
30: public const EXTENSION_TAG = 'phpstan.forbiddenClassNamesExtension';
31:
32: /** @return array<string, string> */
33: public function getClassPrefixes(): array;
34:
35: }
36: