original_string: 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);
      }
code: 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);
      }
code_tokens: 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 ) ; }
docstring: Get all of the listeners and their corresponding events.
  
  @param  iterable  $listeners
  @param  string  $basePath
  @return array
docstring_tokens: Get all of the listeners and their corresponding events .