public function runHooks($name, AbstractContext $context, $reverse = false)
    {
        $parent = $this->getParent();
        $hooks = $this->hooks[$name];

        if ($reverse) { 
            foreach (array_reverse($hooks) as $hook) {
                $hook->run($context); 
            }
            if ($parent) {
                $parent->runHooks($name, $context, $reverse);
            }
        } else {
            if ($parent) {
                $parent->runHooks($name, $context, $reverse);
            }
            foreach ($hooks as $hook) {
                $hook->run($context); 
            }
        } 
    }
public function runHooks($name, AbstractContext $context, $reverse = false)
    {
        $parent = $this->getParent();
        $hooks = $this->hooks[$name];

        if ($reverse) { 
            foreach (array_reverse($hooks) as $hook) {
                $hook->run($context); 
            }
            if ($parent) {
                $parent->runHooks($name, $context, $reverse);
            }
        } else {
            if ($parent) {
                $parent->runHooks($name, $context, $reverse);
            }
            foreach ($hooks as $hook) {
                $hook->run($context); 
            }
        } 
    }
public function runHooks ( $ name , AbstractContext $ context , $ reverse = false ) { $ parent = $ this -> getParent ( ) ; $ hooks = $ this -> hooks [ $ name ] ; if ( $ reverse ) { foreach ( array_reverse ( $ hooks ) as $ hook ) { $ hook -> run ( $ context ) ; } if ( $ parent ) { $ parent -> runHooks ( $ name , $ context , $ reverse ) ; } } else { if ( $ parent ) { $ parent -> runHooks ( $ name , $ context , $ reverse ) ; } foreach ( $ hooks as $ hook ) { $ hook -> run ( $ context ) ; } } }
Traverse ancestry running hooks

@param string $name
Traverse ancestry running hooks