diff --git a/src/bb-modules/Hook/Service.php b/src/bb-modules/Hook/Service.php index daabf1b8f..5c153abbc 100644 --- a/src/bb-modules/Hook/Service.php +++ b/src/bb-modules/Hook/Service.php @@ -112,8 +112,8 @@ class Service implements InjectionAwareInterface $p = $method->getParameters(); if ($method->isPublic() && isset($p[0]) - && $p[0]->getclass() - && in_array($p[0]->getclass()->getName(), ['Box_Event', '\Box_Event'])) { + && $p[0]->getType() && !$p[0]->getType()->isBuiltin() ? new \ReflectionClass($p[0]->getType()->getName()) : null + && in_array($p[0]->getType() && !$p[0]->getType()->isBuiltin() ? new \ReflectionClass($p[0]->getType()->getName()) : null, ['Box_Event', '\Box_Event'])) { $this->connect(['event' => $method->getName(), 'mod' => $mod->getName()]); } }