This commit is contained in:
2026-01-09 01:10:20 +08:00
parent c08c1731d1
commit b2a89a6f72
+6 -3
View File
@@ -29,8 +29,11 @@ readonly class EventListener implements InjectTargetInterface
{ {
// TODO: Implement dispatch() method. // TODO: Implement dispatch() method.
$target = \Kiri::getDi()->getReflectionClass($class)->newInstanceWithoutConstructor(); $target = \Kiri::getDi()->getReflectionClass($class)->newInstanceWithoutConstructor();
on($this->event, [$target, "onHandler"]); if (!($target instanceof EventInterface)) {
throw new Exception("Event listen must implement " . EventInterface::class);
}
on($this->event, [$target, "process"]);
} }
} }