|
|
@@ -34,6 +34,10 @@ readonly class HookAttributeService
|
|
|
$hookClassList = $extension->getHooks();
|
|
|
foreach ($hookClassList as $hookClass) {
|
|
|
$ref = new ReflectionClass($hookClass);
|
|
|
+ $classAttr = $ref->getAttributes(Hook::class);
|
|
|
+ foreach ($classAttr as $attr) {
|
|
|
+ $this->event->listen($attr->newInstance()->hook, $hookClass);
|
|
|
+ }
|
|
|
foreach ($ref->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
|
|
|
$attributes = $method->getAttributes(Hook::class);
|
|
|
foreach ($attributes as $attr) {
|