src/Server/Components/Event/EventDispatcher.php
public function add($type, $listener)
    {
        if (!array_key_exists($type, $this->_eventListeners)) {
            $this->_eventListeners [$type] = [];
        }
        array_push($this->_eventListeners[$type], $listener);
    }
public function add($type, $listener)
    {
        if (!array_key_exists($type, $this->_eventListeners)) {
            $this->_eventListeners [$type] = [];
        }
        array_push($this->_eventListeners[$type], $listener);
    }
public function add ( $ type , $ listener ) { if ( ! array_key_exists ( $ type , $ this -> _eventListeners ) ) { $ this -> _eventListeners [ $ type ] = [ ] ; } array_push ( $ this -> _eventListeners [ $ type ] , $ listener ) ; }
Registers an event listener at a certain object.

@param string $type
@param callable $listener
Registers an event listener at a certain object .