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