original_string: protected function filterEvents(array $events)
      {
          if (! $eventName = $this->option('event')) {
              return $events;
          }
  
          return collect($events)->filter(function ($listeners, $event) use ($eventName) {
              return Str::contains($event, $eventName);
          })->toArray();
      }
code: protected function filterEvents(array $events)
      {
          if (! $eventName = $this->option('event')) {
              return $events;
          }
  
          return collect($events)->filter(function ($listeners, $event) use ($eventName) {
              return Str::contains($event, $eventName);
          })->toArray();
      }
code_tokens: protected function filterEvents ( array $ events ) { if ( ! $ eventName = $ this -> option ( 'event' ) ) { return $ events ; } return collect ( $ events ) -> filter ( function ( $ listeners , $ event ) use ( $ eventName ) { return Str :: contains ( $ event , $ eventName ) ; } ) -> toArray ( ) ; }
docstring: Filter the given events using the provided event name filter.
  
  @param  array  $events
  @return array
docstring_tokens: Filter the given events using the provided event name filter .