This commit is contained in:
2021-03-30 12:07:25 +08:00
parent e6bdda33c2
commit a3ebf29afa
+3 -3
View File
@@ -30,10 +30,10 @@ class Aop extends Component
public function aop_add(array $handler, string $aspect) public function aop_add(array $handler, string $aspect)
{ {
[$class, $method] = $handler; [$class, $method] = $handler;
if (!isset($this->_aop[$aspect])) {
$this->_aop[$aspect] = [];
}
$alias = get_class($class) . '::' . $method; $alias = get_class($class) . '::' . $method;
if (!isset($this->_aop[$alias])) {
$this->_aop[$alias] = [];
}
if (in_array($aspect, $this->_aop[$alias])) { if (in_array($aspect, $this->_aop[$alias])) {
return; return;
} }