eee
This commit is contained in:
+4
-1
@@ -30,7 +30,10 @@ 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"]);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user