src/EventsTrait.php
protected function getEventListeners($event = null): array
    {
        $eventManager = $this->getEventManager();

        return $event !== null && !$eventManager->hasListeners($event) ? [] : $eventManager->getListeners($event);
    }
protected function getEventListeners($event = null): array
    {
        $eventManager = $this->getEventManager();

        return $event !== null && !$eventManager->hasListeners($event) ? [] : $eventManager->getListeners($event);
    }
Get event listeners.

@param string|null $event

@return EventSubscriber[]