public function addEventListener(string $name, callable $listener): self
    {
        if (!isset($this->internalEventListenersData[$name])) {
            $this->internalEventListenersData[$name] = [];
        }
        $this->internalEventListenersData[$name][] = $listener;
        return $this;
    }
public function addEventListener(string $name, callable $listener): self
    {
        if (!isset($this->internalEventListenersData[$name])) {
            $this->internalEventListenersData[$name] = [];
        }
        $this->internalEventListenersData[$name][] = $listener;
        return $this;
    }
public function addEventListener ( string $ name , callable $ listener ) : self { if ( ! isset ( $ this -> internalEventListenersData [ $ name ] ) ) { $ this -> internalEventListenersData [ $ name ] = [ ] ; } $ this -> internalEventListenersData [ $ name ] [ ] = $ listener ; return $ this ; }
Registers a new event listener.

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