2021-03-29 02:34:31 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace Annotation;
|
|
|
|
|
|
|
|
|
|
|
2021-03-29 10:05:51 +08:00
|
|
|
use Exception;
|
2021-08-23 18:58:22 +08:00
|
|
|
use Kiri\AspectManager;
|
2021-08-11 01:04:57 +08:00
|
|
|
use Kiri\IAspect;
|
|
|
|
|
use Kiri\Kiri;
|
2021-03-29 03:09:55 +08:00
|
|
|
|
|
|
|
|
defined('ASPECT_ERROR') or define('ASPECT_ERROR', 'Aspect annotation must implement ');
|
|
|
|
|
|
2021-03-29 02:34:31 +08:00
|
|
|
/**
|
|
|
|
|
* Class Aspect
|
|
|
|
|
* @package Annotation
|
|
|
|
|
*/
|
2021-03-29 03:09:55 +08:00
|
|
|
#[\Attribute(\Attribute::TARGET_METHOD)] class Aspect extends Attribute
|
2021-03-29 02:34:31 +08:00
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Aspect constructor.
|
2021-03-29 03:09:55 +08:00
|
|
|
* @param string $aspect
|
2021-03-29 02:34:31 +08:00
|
|
|
*/
|
2021-08-29 05:53:47 +08:00
|
|
|
public function __construct(public string $aspect)
|
2021-03-29 02:34:31 +08:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2021-07-12 17:17:36 +08:00
|
|
|
/**
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
2021-08-29 05:53:47 +08:00
|
|
|
public function execute(mixed $class, mixed $method = ''): bool
|
2021-03-29 02:34:31 +08:00
|
|
|
{
|
2021-05-03 03:48:52 +08:00
|
|
|
return true;
|
2021-03-29 02:34:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|