2021-11-28 17:43:02 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace CuyZ\Valinor\Tests\Fixture\Object;
|
|
|
|
|
|
|
|
use CuyZ\Valinor\Tests\Fixture\Attribute\AttributeWithArguments;
|
|
|
|
use CuyZ\Valinor\Tests\Fixture\Attribute\BasicAttribute;
|
2022-07-31 15:42:58 +02:00
|
|
|
use CuyZ\Valinor\Tests\Fixture\Attribute\PropertyTargetAttribute;
|
2021-11-28 17:43:02 +01:00
|
|
|
|
|
|
|
#[BasicAttribute]
|
|
|
|
#[AttributeWithArguments('foo', 'bar')]
|
|
|
|
// @PHP8.0 move to anonymous class
|
|
|
|
final class ObjectWithAttributes
|
|
|
|
{
|
|
|
|
#[BasicAttribute]
|
|
|
|
#[AttributeWithArguments('foo', 'bar')]
|
|
|
|
public bool $property;
|
|
|
|
|
2022-07-31 15:42:58 +02:00
|
|
|
public function __construct(#[PropertyTargetAttribute] public bool $promotedProperty)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-11-28 17:43:02 +01:00
|
|
|
#[BasicAttribute]
|
|
|
|
#[AttributeWithArguments('foo', 'bar')]
|
|
|
|
public function method(#[BasicAttribute] string $parameter): void
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|