src/Events.php
public function attachTrigger(TriggerInterface $trigger, $eventNameOrClass, $priority = 1)
    {
        $event = ltrim((string) $eventNameOrClass, '\\');

        $this->events[$event][(int) $priority . '.0'][] = $trigger;

        return $this;
    }
public function attachTrigger(TriggerInterface $trigger, $eventNameOrClass, $priority = 1)
    {
        $event = ltrim((string) $eventNameOrClass, '\\');

        $this->events[$event][(int) $priority . '.0'][] = $trigger;

        return $this;
    }
public function attachTrigger ( TriggerInterface $ trigger , $ eventNameOrClass , $ priority = 1 ) { $ event = ltrim ( ( string ) $ eventNameOrClass , '\\' ) ; $ this -> events [ $ event ] [ ( int ) $ priority . '.0' ] [ ] = $ trigger ; return $ this ; }
Attachs an trigger to the specified event.

@param TriggerInterface $trigger          The event trigger
@param string           $eventNameOrClass The event name or class of event
@param int              $priority         Optional; by default 1. The event priority

@return Events
Attachs an trigger to the specified event .