PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 27.9
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v27.9
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / src / myyoast-client / application / grants / refresh-token-grant.php

refresh-token-grant.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 27.9, at src/myyoast-client/application/grants/refresh-token-grant.php

55 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
3
4 namespace Yoast\WP\SEO\MyYoast_Client\Application\Grants;
5
6 use SensitiveParameter;
7
8 /**
9 * Grant strategy for the Refresh Token flow (RFC 6749 Section 6).
10 *
11 * Exchanges a refresh token for new access and refresh tokens.
12 */
13 class Refresh_Token_Grant implements Grant_Interface {
14
15 /**
16 * The refresh token.
17 *
18 * @var string
19 */
20 private $refresh_token;
21
22 /**
23 * Refresh_Token_Grant constructor.
24 *
25 * @param string $refresh_token The refresh token.
26 */
27 public function __construct(
28 // phpcs:ignore PHPCompatibility.Attributes.NewAttributes.PHPNativeAttributeFound -- No-op on PHP < 8.2; redacts parameter from stack traces on PHP 8.2+.
29 #[SensitiveParameter]
30 string $refresh_token
31 ) {
32 $this->refresh_token = $refresh_token;
33 }
34
35 /**
36 * Returns the grant type identifier.
37 *
38 * @return string
39 */
40 public function get_grant_type(): string {
41 return 'refresh_token';
42 }
43
44 /**
45 * Returns the grant-specific parameters.
46 *
47 * @return array<string, string>
48 */
49 public function get_grant_params(): array {
50 return [
51 'refresh_token' => $this->refresh_token,
52 ];
53 }
54 }
55