original_string: public function getListeners($eventName = NULL)
  	{
  		if($eventName === NULL)
  		{
  			$listeners = [];
  			
  			foreach(array_keys($this->listeners) as $k)
  			{
  				$listeners[$k] = [];
  				
  				foreach(clone $this->listeners[$k] as $listener)
  				{
  					$listeners[$k][] = $listener;
  				}
  			}
  			
  			ksort($listeners);
  			
  			return $listeners;
  		}
  		
  		if($eventName instanceof \ReflectionClass)
  		{
  			$eventName = $eventName->name;
  		}
  		
  		if(empty($this->listeners[$eventName]))
  		{
  			return [];
  		}
  		
  		$listeners = [];
  		
  		foreach(clone $this->listeners[$eventName] as $listener)
  		{
  			$listeners[] = $listener;
  		}
  		
  		return $listeners;
  	}
code: public function getListeners($eventName = NULL)
  	{
  		if($eventName === NULL)
  		{
  			$listeners = [];
  			
  			foreach(array_keys($this->listeners) as $k)
  			{
  				$listeners[$k] = [];
  				
  				foreach(clone $this->listeners[$k] as $listener)
  				{
  					$listeners[$k][] = $listener;
  				}
  			}
  			
  			ksort($listeners);
  			
  			return $listeners;
  		}
  		
  		if($eventName instanceof \ReflectionClass)
  		{
  			$eventName = $eventName->name;
  		}
  		
  		if(empty($this->listeners[$eventName]))
  		{
  			return [];
  		}
  		
  		$listeners = [];
  		
  		foreach(clone $this->listeners[$eventName] as $listener)
  		{
  			$listeners[] = $listener;
  		}
  		
  		return $listeners;
  	}
code_tokens: public function getListeners ( $ eventName = NULL ) { if ( $ eventName === NULL ) { $ listeners = [ ] ; foreach ( array_keys ( $ this -> listeners ) as $ k ) { $ listeners [ $ k ] = [ ] ; foreach ( clone $ this -> listeners [ $ k ] as $ listener ) { $ listeners [ $ k ] [ ] = $ listener ; } } ksort ( $ listeners ) ; return $ listeners ; } if ( $ eventName instanceof \ ReflectionClass ) { $ eventName = $ eventName -> name ; } if ( empty ( $ this -> listeners [ $ eventName ] ) ) { return [ ] ; } $ listeners = [ ] ; foreach ( clone $ this -> listeners [ $ eventName ] as $ listener ) { $ listeners [ ] = $ listener ; } return $ listeners ; }
docstring: Get all event listeners for the given event.
  
  @codeCoverageIgnore
  
  @param string $eventName
  @return array<EventListenerInterface>
docstring_tokens: Get all event listeners for the given event .