src/Watchers/EventWatcher.php
protected function formatListeners($eventName)
    {
        return collect(app('events')->getListeners($eventName))
            ->map(function ($listener) {
                $listener = (new ReflectionFunction($listener))
                        ->getStaticVariables()['listener'];

                if (is_string($listener)) {
                    return Str::contains($listener, '@') ? $listener : $listener.'@handle';
                } elseif (is_array($listener)) {
                    return get_class($listener[0]).'@'.$listener[1];
                }

                return $this->formatClosureListener($listener);
            })->reject(function ($listener) {
                return Str::contains($listener, 'Laravel\\Telescope');
            })->map(function ($listener) {
                if (Str::contains($listener, '@')) {
                    $queued = in_array(ShouldQueue::class, class_implements(explode('@', $listener)[0]));
                }

                return [
                    'name' => $listener,
                    'queued' => $queued ?? false,
                ];
            })->values()->toArray();
    }
protected function formatListeners($eventName)
    {
        return collect(app('events')->getListeners($eventName))
            ->map(function ($listener) {
                $listener = (new ReflectionFunction($listener))
                        ->getStaticVariables()['listener'];

                if (is_string($listener)) {
                    return Str::contains($listener, '@') ? $listener : $listener.'@handle';
                } elseif (is_array($listener)) {
                    return get_class($listener[0]).'@'.$listener[1];
                }

                return $this->formatClosureListener($listener);
            })->reject(function ($listener) {
                return Str::contains($listener, 'Laravel\\Telescope');
            })->map(function ($listener) {
                if (Str::contains($listener, '@')) {
                    $queued = in_array(ShouldQueue::class, class_implements(explode('@', $listener)[0]));
                }

                return [
                    'name' => $listener,
                    'queued' => $queued ?? false,
                ];
            })->values()->toArray();
    }
protected function formatListeners ( $ eventName ) { return collect ( app ( 'events' ) -> getListeners ( $ eventName ) ) -> map ( function ( $ listener ) { $ listener = ( new ReflectionFunction ( $ listener ) ) -> getStaticVariables ( ) [ 'listener' ] ; if ( is_string ( $ listener ) ) { return Str :: contains ( $ listener , '@' ) ? $ listener : $ listener . '@handle' ; } elseif ( is_array ( $ listener ) ) { return get_class ( $ listener [ 0 ] ) . '@' . $ listener [ 1 ] ; } return $ this -> formatClosureListener ( $ listener ) ; } ) -> reject ( function ( $ listener ) { return Str :: contains ( $ listener , 'Laravel\\Telescope' ) ; } ) -> map ( function ( $ listener ) { if ( Str :: contains ( $ listener , '@' ) ) { $ queued = in_array ( ShouldQueue :: class , class_implements ( explode ( '@' , $ listener ) [ 0 ] ) ) ; } return [ 'name' => $ listener , 'queued' => $ queued ?? false , ] ; } ) -> values ( ) -> toArray ( ) ; }
Format list of event listeners.

@param  string  $eventName
@return array
Format list of event listeners .