23 lines
449 B
PHP
23 lines
449 B
PHP
<?php
|
|
|
|
namespace Tests\Aspects;
|
|
|
|
use Attribute;
|
|
|
|
#[Attribute(Attribute::TARGET_METHOD)]
|
|
class BasicAspect
|
|
{
|
|
public ?object $object = null;
|
|
|
|
public function before(object|string $target, mixed ...$args): void
|
|
{
|
|
$this->object = end($args);
|
|
$this->object->before = true;
|
|
}
|
|
|
|
public function after(object|string $target, mixed $return): mixed
|
|
{
|
|
$this->object->after = true;
|
|
return $return;
|
|
}
|
|
}
|