src/Events.php
protected function getTriggers(EventInterface $event)
    {
        $eventName  = $event->getName();
        $eventClass = get_class($event);

        $search = [];

        if (isset($this->events[$eventName])) {
            $search[] = $this->events[$eventName];
        }
        if (isset($this->events[$eventClass])) {
            $search[] = $this->events[$eventClass];
        }

        $parent = $event;
        while ($parent = get_parent_class($parent)) {
            if (isset($this->events[$parent])) {
                $search[] = $this->events[$parent];
            }
        }

        if (empty($search)) {
            return $search;
        }

        $triggers = call_user_func_array('array_merge_recursive', $search);

        krsort($triggers);

        return call_user_func_array('array_merge', $triggers);
    }
protected function getTriggers(EventInterface $event)
    {
        $eventName  = $event->getName();
        $eventClass = get_class($event);

        $search = [];

        if (isset($this->events[$eventName])) {
            $search[] = $this->events[$eventName];
        }
        if (isset($this->events[$eventClass])) {
            $search[] = $this->events[$eventClass];
        }

        $parent = $event;
        while ($parent = get_parent_class($parent)) {
            if (isset($this->events[$parent])) {
                $search[] = $this->events[$parent];
            }
        }

        if (empty($search)) {
            return $search;
        }

        $triggers = call_user_func_array('array_merge_recursive', $search);

        krsort($triggers);

        return call_user_func_array('array_merge', $triggers);
    }
protected function getTriggers ( EventInterface $ event ) { $ eventName = $ event -> getName ( ) ; $ eventClass = get_class ( $ event ) ; $ search = [ ] ; if ( isset ( $ this -> events [ $ eventName ] ) ) { $ search [ ] = $ this -> events [ $ eventName ] ; } if ( isset ( $ this -> events [ $ eventClass ] ) ) { $ search [ ] = $ this -> events [ $ eventClass ] ; } $ parent = $ event ; while ( $ parent = get_parent_class ( $ parent ) ) { if ( isset ( $ this -> events [ $ parent ] ) ) { $ search [ ] = $ this -> events [ $ parent ] ; } } if ( empty ( $ search ) ) { return $ search ; } $ triggers = call_user_func_array ( 'array_merge_recursive' , $ search ) ; krsort ( $ triggers ) ; return call_user_func_array ( 'array_merge' , $ triggers ) ; }
Gets the triggers for the currently event.

@param EventInterface $event The event

@return array
Gets the triggers for the currently event .