src/Events.php
public function attach($eventNameOrClass, $listenerName, $listenerMethod, $priority = 1)
    {
        $trigger = new Trigger($listenerName, $listenerMethod);
        $this->attachTrigger($trigger, $eventNameOrClass, $priority);

        return $this;
    }
public function attach($eventNameOrClass, $listenerName, $listenerMethod, $priority = 1)
    {
        $trigger = new Trigger($listenerName, $listenerMethod);
        $this->attachTrigger($trigger, $eventNameOrClass, $priority);

        return $this;
    }
public function attach ( $ eventNameOrClass , $ listenerName , $ listenerMethod , $ priority = 1 ) { $ trigger = new Trigger ( $ listenerName , $ listenerMethod ) ; $ this -> attachTrigger ( $ trigger , $ eventNameOrClass , $ priority ) ; return $ this ; }
Attachs an listener to the specified event.

@param string $eventNameOrClass The event name or class of event
@param string $listenerName     The name of listener
@param string $listenerMethod   The listener method name
@param int    $priority         Optional; by default 1. The event priority

@return Events
Attachs an listener to the specified event .