This commit is contained in:
2026-01-09 01:10:20 +08:00
parent c08c1731d1
commit b2a89a6f72
+4 -1
View File
@@ -30,7 +30,10 @@ 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"]);
} }
} }