public function unregister(ListenerInterface $listener)
    {
        if (!isset($this->storage[$listener])) {
            throw new InvalidArgumentException('Listener is not registered.');
        }

        foreach ($this->storage[$listener] as $event => $EElistener) {
            $listener->removeListener($event, $EElistener);
        }

        $this->storage->detach($listener);

        return $this;
    }
public function unregister(ListenerInterface $listener)
    {
        if (!isset($this->storage[$listener])) {
            throw new InvalidArgumentException('Listener is not registered.');
        }

        foreach ($this->storage[$listener] as $event => $EElistener) {
            $listener->removeListener($event, $EElistener);
        }

        $this->storage->detach($listener);

        return $this;
    }
public function unregister ( ListenerInterface $ listener ) { if ( ! isset ( $ this -> storage [ $ listener ] ) ) { throw new InvalidArgumentException ( 'Listener is not registered.' ) ; } foreach ( $ this -> storage [ $ listener ] as $ event => $ EElistener ) { $ listener -> removeListener ( $ event , $ EElistener ) ; } $ this -> storage -> detach ( $ listener ) ; return $ this ; }
Unregisters a listener, removes the listener events from the target.

@param ListenerInterface $listener

@return ListenersInterface

@throws InvalidArgumentException In case the listener is not registered
Unregisters a listener removes the listener events from the target .