This commit is contained in:
2023-04-16 02:46:54 +08:00
parent 64d4767a66
commit 0e4d0efdb3
+5 -5
View File
@@ -3,6 +3,7 @@ declare(strict_types=1);
namespace Kiri\Events; namespace Kiri\Events;
use Exception;
use Kiri; use Kiri;
use Kiri\Abstracts\Component; use Kiri\Abstracts\Component;
use Psr\Container\ContainerExceptionInterface; use Psr\Container\ContainerExceptionInterface;
@@ -20,12 +21,11 @@ class EventDispatch extends Component implements EventDispatcherInterface
/** /**
* @param EventProvider $eventProvider * @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 { try {
call_user_func($lists->current(), $event); call_user_func($lists->current(), $event);
} catch (\Throwable $exception) { } catch (\Throwable $exception) {
$this->logger->error($exception->getMessage(), [$exception]); error($exception->getMessage(), [$exception]);
} }
if ($event instanceof StoppableEventInterface && $event->isPropagationStopped()) { if ($event instanceof StoppableEventInterface && $event->isPropagationStopped()) {
break; break;