From b2a89a6f72d481f1246ccdb2f37351132356b901 Mon Sep 17 00:00:00 2001 From: whwyy Date: Fri, 9 Jan 2026 01:10:20 +0800 Subject: [PATCH] eee --- EventListener.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/EventListener.php b/EventListener.php index e237e41..997724d 100644 --- a/EventListener.php +++ b/EventListener.php @@ -29,8 +29,11 @@ readonly class EventListener implements InjectTargetInterface { // TODO: Implement dispatch() method. $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"]); } -} \ No newline at end of file +}