protected static function getListenerEvents($listeners, $basePath)
    {
        $listenerEvents = [];

        foreach ($listeners as $listener) {
            $listener = new ReflectionClass(
                static::classFromFile($listener, $basePath)
            );

            foreach ($listener->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
                if (! Str::is('handle*', $method->name) ||
                    ! isset($method->getParameters()[0])) {
                    continue;
                }

                $listenerEvents[$listener->name.'@'.$method->name] =
                                optional($method->getParameters()[0]->getClass())->name;
            }
        }

        return array_filter($listenerEvents);
    }
protected static function getListenerEvents($listeners, $basePath)
    {
        $listenerEvents = [];

        foreach ($listeners as $listener) {
            $listener = new ReflectionClass(
                static::classFromFile($listener, $basePath)
            );

            foreach ($listener->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
                if (! Str::is('handle*', $method->name) ||
                    ! isset($method->getParameters()[0])) {
                    continue;
                }

                $listenerEvents[$listener->name.'@'.$method->name] =
                                optional($method->getParameters()[0]->getClass())->name;
            }
        }

        return array_filter($listenerEvents);
    }
protected static function getListenerEvents ( $ listeners , $ basePath ) { $ listenerEvents = [ ] ; foreach ( $ listeners as $ listener ) { $ listener = new ReflectionClass ( static :: classFromFile ( $ listener , $ basePath ) ) ; foreach ( $ listener -> getMethods ( ReflectionMethod :: IS_PUBLIC ) as $ method ) { if ( ! Str :: is ( 'handle*' , $ method -> name ) || ! isset ( $ method -> getParameters ( ) [ 0 ] ) ) { continue ; } $ listenerEvents [ $ listener -> name . '@' . $ method -> name ] = optional ( $ method -> getParameters ( ) [ 0 ] -> getClass ( ) ) -> name ; } } return array_filter ( $ listenerEvents ) ; }
Get all of the listeners and their corresponding events.

@param  iterable  $listeners
@param  string  $basePath
@return array
Get all of the listeners and their corresponding events .