public function addHook(Hook $hook, $key = null) {
        $hook->setParser($this);

        if (!$key) {
            $key = explode('\\', get_class($hook));
            $key = str_replace('Hook', '', end($key));
        }

        $this->_hooks[$key] = $hook;

        $hook->setupFilters($this);

        ksort($this->_hooks);

        return $this;
    }
public function addHook(Hook $hook, $key = null) {
        $hook->setParser($this);

        if (!$key) {
            $key = explode('\\', get_class($hook));
            $key = str_replace('Hook', '', end($key));
        }

        $this->_hooks[$key] = $hook;

        $hook->setupFilters($this);

        ksort($this->_hooks);

        return $this;
    }
public function addHook ( Hook $ hook , $ key = null ) { $ hook -> setParser ( $ this ) ; if ( ! $ key ) { $ key = explode ( '\\' , get_class ( $ hook ) ) ; $ key = str_replace ( 'Hook' , '' , end ( $ key ) ) ; } $ this -> _hooks [ $ key ] = $ hook ; $ hook -> setupFilters ( $ this ) ; ksort ( $ this -> _hooks ) ; return $ this ; }
Add hooks that are triggered at specific events.

@param \Decoda\Hook $hook
@param string $key
@return \Decoda\Decoda
Add hooks that are triggered at specific events .