original_string: public function dispatch($name, $event)
      {
          if (!$this->event_dispatcher) {
              return null;
          }
  
          if (!$this->event_dispatcher instanceof Dispatcher) {
              throw new \Exception(
                  'Expected the event dispatcher to be an instance of phpDocumentor\Event\Dispatcher'
              );
          }
  
          $this->event_dispatcher->dispatch($name, $event);
      }
code: public function dispatch($name, $event)
      {
          if (!$this->event_dispatcher) {
              return null;
          }
  
          if (!$this->event_dispatcher instanceof Dispatcher) {
              throw new \Exception(
                  'Expected the event dispatcher to be an instance of phpDocumentor\Event\Dispatcher'
              );
          }
  
          $this->event_dispatcher->dispatch($name, $event);
      }
code_tokens: public function dispatch ( $ name , $ event ) { if ( ! $ this -> event_dispatcher ) { return null ; } if ( ! $ this -> event_dispatcher instanceof Dispatcher ) { throw new \ Exception ( 'Expected the event dispatcher to be an instance of phpDocumentor\Event\Dispatcher' ) ; } $ this -> event_dispatcher -> dispatch ( $ name , $ event ) ; }
docstring: Dispatches an event to the Event Dispatcher.
  
  This method tries to dispatch an event; if no Event Dispatcher has been
  set than this method will explicitly not fail and return null.
  
  By not failing we make the Event Dispatcher optional and is it easier
  for people to re-use this component in their own application.
  
  @param string        $name  Name of the event to dispatch.
  @param EventAbstract $event Arguments for this event.
  
  @throws \Exception if there is a dispatcher but it is not of type EventDispatcher
  
  @return void
docstring_tokens: Dispatches an event to the Event Dispatcher .