src/Ciconia/Event/EmitterTrait.php
public function on($event, callable $callback, $priority = 10)
    {
        if (!isset($this->callbacks[$event])) {
            $this->callbacks[$event] = [true, []];
        }

        $this->callbacks[$event][0] = false;
        $this->callbacks[$event][1][] = array($priority, $callback);

        return $this;
    }
public function on($event, callable $callback, $priority = 10)
    {
        if (!isset($this->callbacks[$event])) {
            $this->callbacks[$event] = [true, []];
        }

        $this->callbacks[$event][0] = false;
        $this->callbacks[$event][1][] = array($priority, $callback);

        return $this;
    }
Adds a listener to the end of the listeners array for the specified event.

@param string   $event    The name of the event
@param callable $callback The callback
@param int      $priority The lower this value, the earlier an event listener will be emitted.

@return EmitterInterface