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