You are here

class RefreshTokenEntityNormalizer in Simple OAuth (OAuth2) & OpenID Connect 5.x

Same name and namespace in other branches
  1. 8.4 src/Normalizer/RefreshTokenEntityNormalizer.php \Drupal\simple_oauth\Normalizer\RefreshTokenEntityNormalizer
  2. 8.2 src/Normalizer/RefreshTokenEntityNormalizer.php \Drupal\simple_oauth\Normalizer\RefreshTokenEntityNormalizer
  3. 8.3 src/Normalizer/RefreshTokenEntityNormalizer.php \Drupal\simple_oauth\Normalizer\RefreshTokenEntityNormalizer

Hierarchy

Expanded class hierarchy of RefreshTokenEntityNormalizer

1 string reference to 'RefreshTokenEntityNormalizer'
simple_oauth.services.yml in ./simple_oauth.services.yml
simple_oauth.services.yml
1 service uses RefreshTokenEntityNormalizer
simple_oauth.normalizer.oauth2_refresh_token in ./simple_oauth.services.yml
Drupal\simple_oauth\Normalizer\RefreshTokenEntityNormalizer

File

src/Normalizer/RefreshTokenEntityNormalizer.php, line 7

Namespace

Drupal\simple_oauth\Normalizer
View source
class RefreshTokenEntityNormalizer extends NormalizerBase implements TokenEntityNormalizerInterface {

  /**
   * The interface or class that this Normalizer supports.
   *
   * @var string|array
   */
  protected $supportedInterfaceOrClass = '\\League\\OAuth2\\Server\\Entities\\RefreshTokenEntityInterface';

  /**
   * {@inheritdoc}
   */
  public function normalize($token_entity, $format = NULL, array $context = []) {

    /** @var \League\OAuth2\Server\Entities\TokenInterface $token_entity */
    return [
      'value' => $token_entity
        ->getIdentifier(),
      'expire' => $token_entity
        ->getExpiryDateTime()
        ->format('U'),
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CacheableNormalizerInterface::SERIALIZATION_CONTEXT_CACHEABILITY constant Name of key for bubbling cacheability metadata via serialization context.
NormalizerBase::$format protected property List of formats which supports (de-)normalization. 3
NormalizerBase::addCacheableDependency protected function Adds cacheability if applicable.
NormalizerBase::checkFormat protected function Checks if the provided format is supported by this normalizer. 1
NormalizerBase::supportsDenormalization public function Implements \Symfony\Component\Serializer\Normalizer\DenormalizerInterface::supportsDenormalization() 1
NormalizerBase::supportsNormalization public function 1
RefreshTokenEntityNormalizer::$supportedInterfaceOrClass protected property The interface or class that this Normalizer supports. Overrides NormalizerBase::$supportedInterfaceOrClass
RefreshTokenEntityNormalizer::normalize public function