*
{@link Immutable::CONSTRUCTOR_WRITE_SCOPE}: write is allowed only in containing class constructor (default choice)
* {@link Immutable::PRIVATE_WRITE_SCOPE}: write is allowed only in places where the property would be accessible if it had 'private' visibility modifier
* {@link Immutable::PROTECTED_WRITE_SCOPE}: write is allowed only in places where the property would be accessible if it had 'protected' visibility modifier
*
* @since 8.0
*/
#[Attribute(Attribute::TARGET_PROPERTY|Attribute::TARGET_CLASS)]
class Immutable
{
public const CONSTRUCTOR_WRITE_SCOPE = "constructor";
public const PRIVATE_WRITE_SCOPE = "private";
public const PROTECTED_WRITE_SCOPE = "protected";
public function __construct(#[ExpectedValues(valuesFromClass: Immutable::class)] $allowedWriteScope = self::CONSTRUCTOR_WRITE_SCOPE) {}
}