src/Publisher/EventPublisher.php
public function addEventListener(EventListenerInterface $eventListener, string $payloadName): EventPublisher
    {
        $this->eventListeners[$payloadName][] = $eventListener;

        return $this;
    }
public function addEventListener(EventListenerInterface $eventListener, string $payloadName): EventPublisher
    {
        $this->eventListeners[$payloadName][] = $eventListener;

        return $this;
    }
public function addEventListener ( EventListenerInterface $ eventListener , string $ payloadName ) : EventPublisher { $ this -> eventListeners [ $ payloadName ] [ ] = $ eventListener ; return $ this ; }
Add event listener.

@param EventListenerInterface $eventListener
@param string                 $payloadName
@return EventPublisher
Add event listener .