original_string: public function getHooks($name = null)
      {
          if (!is_null($name)) {
              return isset($this->hooks[(string) $name]) ? $this->hooks[(string) $name] : null;
          } else {
              return $this->hooks;
          }
      }
code: public function getHooks($name = null)
      {
          if (!is_null($name)) {
              return isset($this->hooks[(string) $name]) ? $this->hooks[(string) $name] : null;
          } else {
              return $this->hooks;
          }
      }
code_tokens: public function getHooks ( $ name = null ) { if ( ! is_null ( $ name ) ) { return isset ( $ this -> hooks [ ( string ) $ name ] ) ? $ this -> hooks [ ( string ) $ name ] : null ; } else { return $ this -> hooks ; } }
docstring: Get hook listeners
  
  Return an array of registered hooks. If `$name` is a valid
  hook name, only the listeners attached to that hook are returned.
  Else, all listeners are returned as an associative array whose
  keys are hook names and whose values are arrays of listeners.
  
  @param  string     $name A hook name (Optional)
  @return array|null
  @api
docstring_tokens: Get hook listeners