friendship ended with social-app. php is my new best friend
1<?php
2/**
3 * Interface TokenRefresh
4 *
5 * @created 29.01.2018
6 * @author smiley <smiley@chillerlan.net>
7 * @copyright 2018 smiley
8 * @license MIT
9 */
10declare(strict_types=1);
11
12namespace chillerlan\OAuth\Core;
13
14/**
15 * Indicates whether the provider is capable of the OAuth2 token refresh.
16 *
17 * @link https://datatracker.ietf.org/doc/html/rfc6749#section-1.5
18 * @link https://datatracker.ietf.org/doc/html/rfc6749#section-6
19 * @link https://datatracker.ietf.org/doc/html/rfc6749#section-10.4
20 */
21interface TokenRefresh{
22
23 /**
24 * Attempts to refresh an existing AccessToken with an associated refresh token and returns a fresh AccessToken.
25 *
26 * @throws \chillerlan\OAuth\Providers\ProviderException
27 */
28 public function refreshAccessToken(AccessToken|null $token = null):AccessToken;
29
30}