public function register(ListenerInterface $listener, EventEmitter $target = null)
    {
        $EElisteners = array();

        if (null !== $target) {
            $EElisteners = $this->forwardEvents($listener, $target, $listener->forwardedEvents());
        }

        $this->storage->attach($listener, $EElisteners);

        return $this;
    }
public function register(ListenerInterface $listener, EventEmitter $target = null)
    {
        $EElisteners = array();

        if (null !== $target) {
            $EElisteners = $this->forwardEvents($listener, $target, $listener->forwardedEvents());
        }

        $this->storage->attach($listener, $EElisteners);

        return $this;
    }
public function register ( ListenerInterface $ listener , EventEmitter $ target = null ) { $ EElisteners = array ( ) ; if ( null !== $ target ) { $ EElisteners = $ this -> forwardEvents ( $ listener , $ target , $ listener -> forwardedEvents ( ) ) ; } $ this -> storage -> attach ( $ listener , $ EElisteners ) ; return $ this ; }
Registers a listener, pass the listener events to the target.

@param ListenerInterface $listener
@param null|EventEmitter $target

@return ListenersInterface
Registers a listener pass the listener events to the target .