public function getEventClassName(string $event)
    {
        if (isset(self::$eventsMap[$event])) {
            return self::$eventsMap[$event];
        }

        $listeners = $this->eventDispatcher->getListeners($event);
        if (empty($listeners)) {
            return null;
        }

        foreach ($listeners as $listener) {
            if (!\is_array($listener) || 2 !== \count($listener)) {
                continue;
            }

            $reflectionMethod = new \ReflectionMethod($listener[0], $listener[1]);
            $args = $reflectionMethod->getParameters();
            if (!$args) {
                continue;
            }

            if (null !== $type = $args[0]->getType()) {
                return (string) $type;
            }
        }

        return null;
    }
public function getEventClassName(string $event)
    {
        if (isset(self::$eventsMap[$event])) {
            return self::$eventsMap[$event];
        }

        $listeners = $this->eventDispatcher->getListeners($event);
        if (empty($listeners)) {
            return null;
        }

        foreach ($listeners as $listener) {
            if (!\is_array($listener) || 2 !== \count($listener)) {
                continue;
            }

            $reflectionMethod = new \ReflectionMethod($listener[0], $listener[1]);
            $args = $reflectionMethod->getParameters();
            if (!$args) {
                continue;
            }

            if (null !== $type = $args[0]->getType()) {
                return (string) $type;
            }
        }

        return null;
    }
public function getEventClassName ( string $ event ) { if ( isset ( self :: $ eventsMap [ $ event ] ) ) { return self :: $ eventsMap [ $ event ] ; } $ listeners = $ this -> eventDispatcher -> getListeners ( $ event ) ; if ( empty ( $ listeners ) ) { return null ; } foreach ( $ listeners as $ listener ) { if ( ! \ is_array ( $ listener ) || 2 !== \ count ( $ listener ) ) { continue ; } $ reflectionMethod = new \ ReflectionMethod ( $ listener [ 0 ] , $ listener [ 1 ] ) ; $ args = $ reflectionMethod -> getParameters ( ) ; if ( ! $ args ) { continue ; } if ( null !== $ type = $ args [ 0 ] -> getType ( ) ) { return ( string ) $ type ; } } return null ; }
Attempts to get the event class for a given event.
Attempts to get the event class for a given event .