public function subscribe($eventName, $callable, $priority = 0)
    {
        unset($this->sorted[$eventName]);           // clear the sorted cache
        $this->subscribers[$eventName][$priority][] = $callable;
    }
public function subscribe($eventName, $callable, $priority = 0)
    {
        unset($this->sorted[$eventName]);           // clear the sorted cache
        $this->subscribers[$eventName][$priority][] = $callable;
    }
public function subscribe ( $ eventName , $ callable , $ priority = 0 ) { unset ( $ this -> sorted [ $ eventName ] ) ; // clear the sorted cache $ this -> subscribers [ $ eventName ] [ $ priority ] [ ] = $ callable ; }
Subscribe to event

@param string   $eventName event name
@param callable $callable  callable
@param integer  $priority  The higher this value, the earlier we handle event

@return void
Subscribe to event