public function clearHooks($name = null)
    {
        if (!is_null($name) && isset($this->hooks[(string) $name])) {
            $this->hooks[(string) $name] = array(array());
        } else {
            foreach ($this->hooks as $key => $value) {
                $this->hooks[$key] = array(array());
            }
        }
    }
public function clearHooks($name = null)
    {
        if (!is_null($name) && isset($this->hooks[(string) $name])) {
            $this->hooks[(string) $name] = array(array());
        } else {
            foreach ($this->hooks as $key => $value) {
                $this->hooks[$key] = array(array());
            }
        }
    }
public function clearHooks ( $ name = null ) { if ( ! is_null ( $ name ) && isset ( $ this -> hooks [ ( string ) $ name ] ) ) { $ this -> hooks [ ( string ) $ name ] = array ( array ( ) ) ; } else { foreach ( $ this -> hooks as $ key => $ value ) { $ this -> hooks [ $ key ] = array ( array ( ) ) ; } } }
Clear hook listeners

Clear all listeners for all hooks. If `$name` is
a valid hook name, only the listeners attached
to that hook will be cleared.

@param  string $name A hook name (Optional)
@api
Clear hook listeners