File "PropertyHookAsymmetric.php"
Full Path: /var/www/html/back/vendor/phpdocumentor/reflection/tests/integration/data/PHP84/PropertyHookAsymmetric.php
File size: 522 bytes
MIME-type: text/x-php
Charset: utf-8
<?php
declare(strict_types=1);
class PropertyHook
{
private bool $modified = false;
/** @var string this is my property */
#[Property(new DateTimeImmutable())]
public private(set) string $example = 'default value' {
get {
if ($this->modified) {
return $this->foo . ' (modified)';
}
return $this->foo;
}
set(string|int $value) {
$this->foo = strtolower($value);
$this->modified = true;
}
}
}