1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\Rules\Constants;
4:
5: use PHPStan\DependencyInjection\ExtensionInterface;
6: use PHPStan\Reflection\ClassConstantReflection;
7:
8: /**
9: * This is the extension interface to implement if you want to describe
10: * always-used class constant.
11: *
12: * To register it in the configuration file use the `phpstan.constants.alwaysUsedClassConstantsExtension` service tag:
13: *
14: * ```
15: * services:
16: * -
17: * class: App\PHPStan\MyExtension
18: * tags:
19: * - phpstan.constants.alwaysUsedClassConstantsExtension
20: * ```
21: *
22: * Learn more: https://phpstan.org/developing-extensions/always-used-class-constants
23: *
24: * @api
25: */
26: #[ExtensionInterface(tag: 'phpstan.constants.alwaysUsedClassConstantsExtension')]
27: interface AlwaysUsedClassConstantsExtension
28: {
29:
30: public function isAlwaysUsed(ClassConstantReflection $constant): bool;
31:
32: }
33: