.
This commit is contained in:
commit
a5ce423afe
30 changed files with 1807 additions and 0 deletions
23
tests/Aspects/BasicAspect.php
Normal file
23
tests/Aspects/BasicAspect.php
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<?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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue