From 0e4d0efdb3dfa910f34bc6014b22ec1ffe9b2747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Sun, 16 Apr 2023 02:46:54 +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 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/EventDispatch.php b/EventDispatch.php index bced84c..666dd4f 100644 --- a/EventDispatch.php +++ b/EventDispatch.php @@ -3,6 +3,7 @@ declare(strict_types=1); namespace Kiri\Events; +use Exception; use Kiri; use Kiri\Abstracts\Component; use Psr\Container\ContainerExceptionInterface; @@ -20,12 +21,11 @@ class EventDispatch extends Component implements EventDispatcherInterface /** * @param EventProvider $eventProvider - * @param array $config - * @throws \Exception + * @throws Exception */ - public function __construct(public EventProvider $eventProvider, array $config = []) + public function __construct(public EventProvider $eventProvider) { - parent::__construct($config); + parent::__construct(); } @@ -46,7 +46,7 @@ class EventDispatch extends Component implements EventDispatcherInterface try { call_user_func($lists->current(), $event); } catch (\Throwable $exception) { - $this->logger->error($exception->getMessage(), [$exception]); + error($exception->getMessage(), [$exception]); } if ($event instanceof StoppableEventInterface && $event->isPropagationStopped()) { break;