变更
This commit is contained in:
+2
-12
@@ -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
|
* @param object $event
|
||||||
* @return object
|
* @return object
|
||||||
* @throws ContainerExceptionInterface
|
* @throws ContainerExceptionInterface
|
||||||
* @throws NotFoundExceptionInterface
|
* @throws NotFoundExceptionInterface|\ReflectionException
|
||||||
*/
|
*/
|
||||||
public function dispatch(object $event): object
|
public function dispatch(object $event): object
|
||||||
{
|
{
|
||||||
$lists = $this->eventProvider->getListenersForEvent($event);
|
$lists = Kiri::getDi()->get(EventProvider::class)->getListenersForEvent($event);
|
||||||
if (!$lists->valid()) {
|
if (!$lists->valid()) {
|
||||||
return $event;
|
return $event;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user