public function dispatchEvent($eventName, Event $event = null)
    {
        if ($this->eventDispatcher instanceof EventDispatcherInterface) {
            $this->eventDispatcher->dispatch($eventName, $event);
        }
    }
public function dispatchEvent($eventName, Event $event = null)
    {
        if ($this->eventDispatcher instanceof EventDispatcherInterface) {
            $this->eventDispatcher->dispatch($eventName, $event);
        }
    }
public function dispatchEvent ( $ eventName , Event $ event = null ) { if ( $ this -> eventDispatcher instanceof EventDispatcherInterface ) { $ this -> eventDispatcher -> dispatch ( $ eventName , $ event ) ; } }
Dispatches an event to the event dispatcher, if one has been configured.

@param string $eventName The name of the event to dispatch
@param Event|null $event The (optional) event object
Dispatches an event to the event dispatcher if one has been configured .