modify
This commit is contained in:
+3
-6
@@ -51,16 +51,13 @@ class Aop extends Component
|
||||
return call_user_func($close, ...$get_args);
|
||||
}
|
||||
|
||||
$reflect = new \ReflectionClass($this->_aop[$aopName]);
|
||||
if (!$reflect->hasMethod('invoke')) {
|
||||
$reflect = Snowflake::getDi()->getReflect($this->_aop[$aopName]);
|
||||
if (!$reflect->isInstantiable() || !$reflect->hasMethod('invoke')) {
|
||||
throw new \Exception(ASPECT_ERROR . IAspect::class);
|
||||
}
|
||||
$method = $reflect->getMethod('invoke');
|
||||
|
||||
$data = $method->invokeArgs($reflect->newInstance($close), $get_args);
|
||||
if ($method->getReturnType() !== null) {
|
||||
return $data;
|
||||
}
|
||||
return $method->invokeArgs($reflect->newInstance($close), $get_args);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user