modify
This commit is contained in:
+7
-10
@@ -28,23 +28,20 @@ defined('ASPECT_ERROR') or define('ASPECT_ERROR', 'Aspect annotation must implem
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $handler
|
||||
* @return mixed
|
||||
* @throws Exception
|
||||
*/
|
||||
public function execute(array $handler): mixed
|
||||
|
||||
|
||||
public function execute(mixed $class, mixed $method = ''): mixed
|
||||
{
|
||||
// TODO: Change the autogenerated stub
|
||||
if (!in_array(IAspect::class, class_implements($this->aspect))) {
|
||||
// TODO: Change the autogenerated stub
|
||||
if (!in_array(IAspect::class, class_implements($this->aspect))) {
|
||||
throw new Exception(ASPECT_ERROR . IAspect::class);
|
||||
}
|
||||
/** @var Aop $aop */
|
||||
$aop = Snowflake::app()->get('aop');
|
||||
|
||||
$aop->aop_add($handler, $this->aspect);
|
||||
$aop->aop_add([$class, $method], $this->aspect);
|
||||
|
||||
return parent::execute($handler);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user