@@ -30,7 +30,7 @@ |
||
30 | 30 | /** |
31 | 31 | * Create new refresh token |
32 | 32 | */ |
33 | - public function create(IClient $client, string|int|null $userId, array $scope = []): IRefreshToken |
|
33 | + public function create(IClient $client, string | int | null $userId, array $scope = []): IRefreshToken |
|
34 | 34 | { |
35 | 35 | $expires = new DateTime; |
36 | 36 | $expires->modify('+' . $this->lifetime . ' seconds'); |
@@ -28,7 +28,7 @@ |
||
28 | 28 | * @throws InvalidScopeException |
29 | 29 | * @return ITokens |
30 | 30 | */ |
31 | - public function create(IClient $client, string|int|null $userId, array $scope = []): ITokens; |
|
31 | + public function create(IClient $client, string | int | null $userId, array $scope = []): ITokens; |
|
32 | 32 | |
33 | 33 | /** |
34 | 34 | * Returns token entity |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | * @param string|null $clientSecret |
17 | 17 | * @return IClient|null |
18 | 18 | */ |
19 | - public function getClient(string|int $clientId, #[\SensitiveParameter] ?string $clientSecret = null): ?IClient; |
|
19 | + public function getClient(string | int $clientId, #[\SensitiveParameter] ?string $clientSecret = null): ?IClient; |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * Can client use given grant type |
@@ -24,5 +24,5 @@ discard block |
||
24 | 24 | * @param string $grantType |
25 | 25 | * @return bool |
26 | 26 | */ |
27 | - public function canUseGrantType(string|int $clientId, string $grantType): bool; |
|
27 | + public function canUseGrantType(string | int $clientId, string $grantType): bool; |
|
28 | 28 | } |
@@ -14,13 +14,13 @@ |
||
14 | 14 | * Get client id |
15 | 15 | * @return string|int |
16 | 16 | */ |
17 | - public function getId(): string|int; |
|
17 | + public function getId(): string | int; |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * Get client secret code |
21 | 21 | * @return string|int |
22 | 22 | */ |
23 | - public function getSecret(): string|int; |
|
23 | + public function getSecret(): string | int; |
|
24 | 24 | |
25 | 25 | /** |
26 | 26 | * Get client redirect URL |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | * @param string|null $clientSecret |
33 | 33 | * @return IClient|null |
34 | 34 | */ |
35 | - public function getClient(string|int $clientId, #[\SensitiveParameter] string|null $clientSecret = null): ?IClient |
|
35 | + public function getClient(string | int $clientId, #[\SensitiveParameter] string | null $clientSecret = null): ?IClient |
|
36 | 36 | { |
37 | 37 | if (!$clientId) { |
38 | 38 | return null; |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @param string $grantType |
69 | 69 | * @return bool |
70 | 70 | */ |
71 | - public function canUseGrantType(string|int $clientId, string $grantType): bool |
|
71 | + public function canUseGrantType(string | int $clientId, string $grantType): bool |
|
72 | 72 | { |
73 | 73 | $result = $this->context->query(' |
74 | 74 | SELECT g.name |
@@ -79,7 +79,7 @@ |
||
79 | 79 | return new RefreshToken( |
80 | 80 | strval($row['refresh_token']), |
81 | 81 | new DateTime(strval($row['expires_at'])), |
82 | - is_numeric($row['client_id'])? intval($row['client_id']) : strval($row['client_id']), |
|
82 | + is_numeric($row['client_id']) ? intval($row['client_id']) : strval($row['client_id']), |
|
83 | 83 | is_null($row['user_id']) ? null : strval($row['user_id']), |
84 | 84 | ); |
85 | 85 | } |
@@ -114,7 +114,7 @@ |
||
114 | 114 | return new AccessToken( |
115 | 115 | strval($row['access_token']), |
116 | 116 | new DateTime(strval($row['expires_at'])), |
117 | - is_numeric($row['client_id'])? intval($row['client_id']) : strval($row['client_id']), |
|
117 | + is_numeric($row['client_id']) ? intval($row['client_id']) : strval($row['client_id']), |
|
118 | 118 | is_null($row['user_id']) ? null : strval($row['user_id']), |
119 | 119 | array_map('strval', array_keys($scopes)) |
120 | 120 | ); |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | public function __construct( |
24 | 24 | private readonly string $accessToken, |
25 | 25 | private readonly DateTime $expires, |
26 | - private readonly string|int $clientId, |
|
27 | - private readonly string|int|null $userId, |
|
26 | + private readonly string | int $clientId, |
|
27 | + private readonly string | int | null $userId, |
|
28 | 28 | private readonly array $scope, |
29 | 29 | ) |
30 | 30 | { |
@@ -35,12 +35,12 @@ discard block |
||
35 | 35 | return $this->accessToken; |
36 | 36 | } |
37 | 37 | |
38 | - public function getClientId(): string|int |
|
38 | + public function getClientId(): string | int |
|
39 | 39 | { |
40 | 40 | return $this->clientId; |
41 | 41 | } |
42 | 42 | |
43 | - public function getUserId(): string|int|null |
|
43 | + public function getUserId(): string | int | null |
|
44 | 44 | { |
45 | 45 | return $this->userId; |
46 | 46 | } |
@@ -11,14 +11,14 @@ |
||
11 | 11 | { |
12 | 12 | |
13 | 13 | public function __construct( |
14 | - private readonly string|int $id, |
|
14 | + private readonly string | int $id, |
|
15 | 15 | #[\SensitiveParameter] private readonly string $secret, |
16 | 16 | private readonly string $redirectUrl, |
17 | 17 | ) |
18 | 18 | { |
19 | 19 | } |
20 | 20 | |
21 | - public function getId(): string|int |
|
21 | + public function getId(): string | int |
|
22 | 22 | { |
23 | 23 | return $this->id; |
24 | 24 | } |