original_string: protected function ensureListener($listener)
      {
          if ($listener instanceof ListenerInterface) {
              return $listener;
          }
  
          if (is_callable($listener)) {
              return CallbackListener::fromCallable($listener);
          }
  
          throw new InvalidArgumentException('Listeners should be be ListenerInterface, Closure or callable. Received type: '.gettype($listener));
      }
code: protected function ensureListener($listener)
      {
          if ($listener instanceof ListenerInterface) {
              return $listener;
          }
  
          if (is_callable($listener)) {
              return CallbackListener::fromCallable($listener);
          }
  
          throw new InvalidArgumentException('Listeners should be be ListenerInterface, Closure or callable. Received type: '.gettype($listener));
      }
code_tokens: protected function ensureListener ( $ listener ) { if ( $ listener instanceof ListenerInterface ) { return $ listener ; } if ( is_callable ( $ listener ) ) { return CallbackListener :: fromCallable ( $ listener ) ; } throw new InvalidArgumentException ( 'Listeners should be be ListenerInterface, Closure or callable. Received type: ' . gettype ( $ listener ) ) ; }
docstring: Ensure the input is a listener.
  
  @param ListenerInterface|callable $listener
  
  @throws InvalidArgumentException
  
  @return ListenerInterface
docstring_tokens: Ensure the input is a listener .