getListenersForEvent($event); return $this->execute($lists, $event); } /** * @param SplPriorityQueue $lists * @param object $event * @return object */ public function execute(SplPriorityQueue $lists, object $event): object { if ($lists->isEmpty()) { return $event; } foreach ($lists as $item) { try { call_user_func($item, $event); } catch (\Throwable $exception) { error($exception); } if ($event instanceof StoppableEventInterface && $event->isPropagationStopped()) { break; } } return $event; } }