public function removeEventListener(string $name, callable $listener): self
    {
        if (isset($this->internalEventListenersData[$name])) {
            foreach ($this->internalEventListenersData[$name] as $i => $value) {
                if ($value === $listener) {
                    unset($this->internalEventListenersData[$name][$i]);
                    if (empty($this->internalEventListenersData[$name])) {
                        unset($this->internalEventListenersData[$name]);
                    }
                    break;
                }
            }
        }
        return $this;
    }
public function removeEventListener(string $name, callable $listener): self
    {
        if (isset($this->internalEventListenersData[$name])) {
            foreach ($this->internalEventListenersData[$name] as $i => $value) {
                if ($value === $listener) {
                    unset($this->internalEventListenersData[$name][$i]);
                    if (empty($this->internalEventListenersData[$name])) {
                        unset($this->internalEventListenersData[$name]);
                    }
                    break;
                }
            }
        }
        return $this;
    }
public function removeEventListener ( string $ name , callable $ listener ) : self { if ( isset ( $ this -> internalEventListenersData [ $ name ] ) ) { foreach ( $ this -> internalEventListenersData [ $ name ] as $ i => $ value ) { if ( $ value === $ listener ) { unset ( $ this -> internalEventListenersData [ $ name ] [ $ i ] ) ; if ( empty ( $ this -> internalEventListenersData [ $ name ] ) ) { unset ( $ this -> internalEventListenersData [ $ name ] ) ; } break ; } } } return $ this ; }
Removes a registered event listener.

@param string $name The name of the event.
@param callable $listener A listener callback.
@return self Returns a reference to itself.
Removes a registered event listener .