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