From e035b6248e911d6882014e062b7c294ee5cc68e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Mon, 17 Apr 2023 01:39:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EventDispatch.php | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/EventDispatch.php b/EventDispatch.php index 666dd4f..ae88e11 100644 --- a/EventDispatch.php +++ b/EventDispatch.php @@ -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; }