This commit is contained in:
2023-04-17 01:39:32 +08:00
parent 0e4d0efdb3
commit e035b6248e
+2 -12
View File
@@ -19,25 +19,15 @@ class EventDispatch extends Component implements EventDispatcherInterface
{
/**
* @param EventProvider $eventProvider
* @throws Exception
*/
public function __construct(public EventProvider $eventProvider)
{
parent::__construct();
}
/**
* @param object $event
* @return object
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
* @throws NotFoundExceptionInterface|\ReflectionException
*/
public function dispatch(object $event): object
{
$lists = $this->eventProvider->getListenersForEvent($event);
$lists = Kiri::getDi()->get(EventProvider::class)->getListenersForEvent($event);
if (!$lists->valid()) {
return $event;
}