public function getHooks($name = null)
    {
        if (!is_null($name)) {
            return isset($this->hooks[(string) $name]) ? $this->hooks[(string) $name] : null;
        } else {
            return $this->hooks;
        }
    }
public function getHooks($name = null)
    {
        if (!is_null($name)) {
            return isset($this->hooks[(string) $name]) ? $this->hooks[(string) $name] : null;
        } else {
            return $this->hooks;
        }
    }
public function getHooks ( $ name = null ) { if ( ! is_null ( $ name ) ) { return isset ( $ this -> hooks [ ( string ) $ name ] ) ? $ this -> hooks [ ( string ) $ name ] : null ; } else { return $ this -> hooks ; } }
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
Get hook listeners