src/phpDocumentor/Plugin/Core/Descriptor/Validator/ValidatorAbstract.php
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);
    }
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);
    }
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 ) ; }
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
Dispatches an event to the Event Dispatcher .