变更
This commit is contained in:
+5
-5
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user