function removeListener(string $event, callable $listener) {
        if(isset($this->listeners[$event])) {
            $index = \array_search($listener, $this->listeners[$event], true);
            if($index !== false) {
                unset($this->listeners[$event][$index]);
                if(\count($this->listeners[$event]) === 0) {
                    unset($this->listeners[$event]);
                }
            }
        }
        
        if(isset($this->onceListeners[$event])) {
            $index = \array_search($listener, $this->onceListeners[$event], true);
            if($index !== false) {
                unset($this->onceListeners[$event][$index]);
                if(\count($this->onceListeners[$event]) === 0) {
                    unset($this->onceListeners[$event]);
                }
            }
        }
        
        return $this;
    }
function removeListener(string $event, callable $listener) {
        if(isset($this->listeners[$event])) {
            $index = \array_search($listener, $this->listeners[$event], true);
            if($index !== false) {
                unset($this->listeners[$event][$index]);
                if(\count($this->listeners[$event]) === 0) {
                    unset($this->listeners[$event]);
                }
            }
        }
        
        if(isset($this->onceListeners[$event])) {
            $index = \array_search($listener, $this->onceListeners[$event], true);
            if($index !== false) {
                unset($this->onceListeners[$event][$index]);
                if(\count($this->onceListeners[$event]) === 0) {
                    unset($this->onceListeners[$event]);
                }
            }
        }
        
        return $this;
    }
function removeListener ( string $ event , callable $ listener ) { if ( isset ( $ this -> listeners [ $ event ] ) ) { $ index = \ array_search ( $ listener , $ this -> listeners [ $ event ] , true ) ; if ( $ index !== false ) { unset ( $ this -> listeners [ $ event ] [ $ index ] ) ; if ( \ count ( $ this -> listeners [ $ event ] ) === 0 ) { unset ( $ this -> listeners [ $ event ] ) ; } } } if ( isset ( $ this -> onceListeners [ $ event ] ) ) { $ index = \ array_search ( $ listener , $ this -> onceListeners [ $ event ] , true ) ; if ( $ index !== false ) { unset ( $ this -> onceListeners [ $ event ] [ $ index ] ) ; if ( \ count ( $ this -> onceListeners [ $ event ] ) === 0 ) { unset ( $ this -> onceListeners [ $ event ] ) ; } } } return $ this ; }
Remove specified listener from an event.
@param string    $event
@param callable  $listener
@return $this
Remove specified listener from an event .