1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\Rules\Properties;
4:
5: use PHPStan\DependencyInjection\ExtensionInterface;
6: use PHPStan\Reflection\ExtendedPropertyReflection;
7:
8: /**
9: * This is the extension interface to implement if you want to describe
10: * always-read or always-written properties.
11: *
12: * To register it in the configuration file use the `phpstan.properties.readWriteExtension` service tag:
13: *
14: * ```
15: * services:
16: * -
17: * class: App\PHPStan\MyExtension
18: * tags:
19: * - phpstan.properties.readWriteExtension
20: * ```
21: *
22: * Learn more: https://phpstan.org/developing-extensions/always-read-written-properties
23: *
24: * @api
25: */
26: #[ExtensionInterface(tag: 'phpstan.properties.readWriteExtension')]
27: interface ReadWritePropertiesExtension
28: {
29:
30: public function isAlwaysRead(ExtendedPropertyReflection $property, string $propertyName): bool;
31:
32: public function isAlwaysWritten(ExtendedPropertyReflection $property, string $propertyName): bool;
33:
34: public function isInitialized(ExtendedPropertyReflection $property, string $propertyName): bool;
35:
36: }
37: