WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Самая быстрая Тема-конструктор для WordPress
класс не описан

YoastSEO_Vendor\League\OAuth2\Client\Grant

AbstractGrant{} Yoast 1.0

Represents a type of authorization grant.

An authorization grant is a credential representing the resource owner's authorization (to access its protected resources) used by the client to obtain an access token. OAuth 2.0 defines four grant types -- authorization code, implicit, resource owner password credentials, and client credentials -- as well as an extensibility mechanism for defining additional types.

Хуков нет.

Возвращает

Null. Ничего.

Использование

$AbstractGrant = new AbstractGrant();
// use class methods

Методы

  1. __toString()
  2. getName()
  3. getRequiredRequestParameters()
  4. prepareRequestParameters(array $defaults, array $options)

Код AbstractGrant{} Yoast 15.1.1

<?php
abstract class AbstractGrant
{
    use RequiredParameterTrait;
    /**
     * Returns the name of this grant, eg. 'grant_name', which is used as the
     * grant type when encoding URL query parameters.
     *
     * @return string
     */
    protected abstract function getName();
    /**
     * Returns a list of all required request parameters.
     *
     * @return array
     */
    protected abstract function getRequiredRequestParameters();
    /**
     * Returns this grant's name as its string representation. This allows for
     * string interpolation when building URL query parameters.
     *
     * @return string
     */
    public function __toString()
    {
        return $this->getName();
    }
    /**
     * Prepares an access token request's parameters by checking that all
     * required parameters are set, then merging with any given defaults.
     *
     * @param  array $defaults
     * @param  array $options
     * @return array
     */
    public function prepareRequestParameters(array $defaults, array $options)
    {
        $defaults['grant_type'] = $this->getName();
        $required = $this->getRequiredRequestParameters();
        $provided = \array_merge($defaults, $options);
        $this->checkRequiredParameters($required, $provided);
        return $provided;
    }
}