@@ -42,7 +42,7 @@ |
||
42 | 42 | * @param \ReflectionClass<object>|\ReflectionMethod $element |
43 | 43 | * @throws ForbiddenRequestException |
44 | 44 | */ |
45 | - public function checkRequirements(\ReflectionClass|\ReflectionMethod $element): void |
|
45 | + public function checkRequirements(\ReflectionClass | \ReflectionMethod $element): void |
|
46 | 46 | { |
47 | 47 | parent::checkRequirements($element); |
48 | 48 | $accessToken = $this->input->getAuthorization(); |
@@ -27,5 +27,5 @@ |
||
27 | 27 | * Get authorization token |
28 | 28 | * @return string|null |
29 | 29 | */ |
30 | - public function getAuthorization(): string|null; |
|
30 | + public function getAuthorization(): string | null; |
|
31 | 31 | } |
@@ -116,7 +116,6 @@ |
||
116 | 116 | { |
117 | 117 | $scope = $this->input->getParameter(self::SCOPE_KEY); |
118 | 118 | return !is_array($scope) ? |
119 | - array_filter(explode(',', str_replace(' ', ',', strval($scope)))) : |
|
120 | - array_filter(array_map('strval', $scope)); |
|
119 | + array_filter(explode(',', str_replace(' ', ',', strval($scope)))) : array_filter(array_map('strval', $scope)); |
|
121 | 120 | } |
122 | 121 | } |
@@ -56,7 +56,7 @@ |
||
56 | 56 | */ |
57 | 57 | public static function install(Configurator $configurator): void |
58 | 58 | { |
59 | - $configurator->onCompile[] = function ($configurator, $compiler): void { |
|
59 | + $configurator->onCompile[] = function($configurator, $compiler): void { |
|
60 | 60 | $compiler->addExtension('oauth2', new Extension); |
61 | 61 | }; |
62 | 62 | } |
@@ -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 | ); |
@@ -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 | } |
@@ -30,7 +30,7 @@ |
||
30 | 30 | /** |
31 | 31 | * Create access token |
32 | 32 | */ |
33 | - public function create(IClient $client, string|int|null $userId, array $scope = []): IAccessToken |
|
33 | + public function create(IClient $client, string | int | null $userId, array $scope = []): IAccessToken |
|
34 | 34 | { |
35 | 35 | $accessExpires = new DateTime; |
36 | 36 | $accessExpires->modify('+' . $this->lifetime . ' seconds'); |
@@ -25,8 +25,8 @@ discard block |
||
25 | 25 | public function __construct( |
26 | 26 | private readonly string $accessToken, |
27 | 27 | private readonly DateTime $expires, |
28 | - private readonly string|int $clientId, |
|
29 | - private readonly string|int|null $userId, |
|
28 | + private readonly string | int $clientId, |
|
29 | + private readonly string | int | null $userId, |
|
30 | 30 | private readonly array $scope |
31 | 31 | ) |
32 | 32 | { |
@@ -37,12 +37,12 @@ discard block |
||
37 | 37 | return $this->accessToken; |
38 | 38 | } |
39 | 39 | |
40 | - public function getClientId(): string|int |
|
40 | + public function getClientId(): string | int |
|
41 | 41 | { |
42 | 42 | return $this->clientId; |
43 | 43 | } |
44 | 44 | |
45 | - public function getUserId(): string|int|null |
|
45 | + public function getUserId(): string | int | null |
|
46 | 46 | { |
47 | 47 | return $this->userId; |
48 | 48 | } |