src/Event/EventDispatcher.php
public function register(string $eventCode, callable $listener)
    {
        $this->assertValidEventCode($eventCode);
        if (false === isset($this->eventListeners[$eventCode])) {
            $this->eventListeners[$eventCode] = [];
        }
        $this->eventListeners[$eventCode][] = $listener;

        return $this;
    }
public function register(string $eventCode, callable $listener)
    {
        $this->assertValidEventCode($eventCode);
        if (false === isset($this->eventListeners[$eventCode])) {
            $this->eventListeners[$eventCode] = [];
        }
        $this->eventListeners[$eventCode][] = $listener;

        return $this;
    }
public function register ( string $ eventCode , callable $ listener ) { $ this -> assertValidEventCode ( $ eventCode ) ; if ( false === isset ( $ this -> eventListeners [ $ eventCode ] ) ) { $ this -> eventListeners [ $ eventCode ] = [ ] ; } $ this -> eventListeners [ $ eventCode ] [ ] = $ listener ; return $ this ; }
Register a listener for the given event code

@param string   $eventCode
@param callable $listener
@return $this
Register a listener for the given event code