original_string: 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());
              }
          }
      }
code: 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());
              }
          }
      }
code_tokens: 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 ( ) ) ; } } }
docstring: 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
docstring_tokens: Clear hook listeners