Skip to content

Commit dc764b7

Browse files
github-actionsgithub-actions[bot]
authored andcommitted
style(php-cs-fixer): fix coding standards
1 parent d2a93c7 commit dc764b7

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

src/Authentication/Handler/MetadataHandler.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace Mcp\Server\Authentication\Handler;
66

7-
use JsonException;
87
use Mcp\Server\Authentication\Dto\OAuthMetadata;
98
use Mcp\Server\Authentication\Dto\OAuthProtectedResourceMetadata;
109
use Psr\Http\Message\ResponseFactoryInterface;
@@ -25,7 +24,7 @@ public function __construct(
2524
) {}
2625

2726
/**
28-
* @throws JsonException
27+
* @throws \JsonException
2928
*/
3029
public function handleOAuthMetadata(ServerRequestInterface $request): ResponseInterface
3130
{
@@ -40,7 +39,7 @@ public function handleOAuthMetadata(ServerRequestInterface $request): ResponseIn
4039
}
4140

4241
/**
43-
* @throws JsonException
42+
* @throws \JsonException
4443
*/
4544
public function handleProtectedResourceMetadata(ServerRequestInterface $request): ResponseInterface
4645
{

src/Authentication/Provider/GenericTokenVerifier.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ private function buildUserProfileFromUserInfo(array $data): UserProfile
105105
$mappedData = $this->mapFields($data, $this->config->userFieldMapping);
106106

107107
return new UserProfile(
108-
sub: $mappedData['sub'] ?? $data['id'] ?? (string)($data['user_id'] ?? 'unknown'),
108+
sub: $mappedData['sub'] ?? $data['id'] ?? (string) ($data['user_id'] ?? 'unknown'),
109109
preferredUsername: $mappedData['preferred_username'] ?? $data['login'] ?? $data['username'] ?? null,
110110
name: $mappedData['name'] ?? $data['name'] ?? null,
111111
email: $mappedData['email'] ?? $data['email'] ?? null,
@@ -145,15 +145,15 @@ private function createAuthInfo(string $token, array $tokenData, UserProfile $us
145145
if (isset($tokenData['scope'])) {
146146
$scopes = \is_array($tokenData['scope'])
147147
? $tokenData['scope']
148-
: \explode(' ', (string)$tokenData['scope']);
148+
: \explode(' ', (string) $tokenData['scope']);
149149
} elseif (isset($tokenData['scopes'])) {
150150
$scopes = \is_array($tokenData['scopes']) ? $tokenData['scopes'] : [$tokenData['scopes']];
151151
}
152152

153153
// Extract expiration
154154
$expiresAt = $tokenData['exp'] ?? null;
155155
if ($expiresAt !== null && !\is_int($expiresAt)) {
156-
$expiresAt = (int)$expiresAt;
156+
$expiresAt = (int) $expiresAt;
157157
}
158158

159159
// Extract resource/audience
@@ -167,7 +167,7 @@ private function createAuthInfo(string $token, array $tokenData, UserProfile $us
167167

168168
return new DefaultAuthInfo(
169169
token: $token,
170-
clientId: (string)$clientId,
170+
clientId: (string) $clientId,
171171
scopes: $scopes,
172172
expiresAt: $expiresAt,
173173
resource: $resource,

src/Authentication/Provider/ProxyClientsStore.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function registerClient(OAuthClientInformation $client): OAuthClientInfor
5050
throw new ServerError("Client registration failed: {$response->getStatusCode()}");
5151
}
5252

53-
$data = \json_decode((string)$response->getBody(), true);
53+
$data = \json_decode((string) $response->getBody(), true);
5454
if (\json_last_error() !== JSON_ERROR_NONE) {
5555
throw new ServerError('Invalid JSON response from registration endpoint');
5656
}

src/Authentication/Provider/TokenIntrospectionClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function introspectToken(string $token, string $introspectionUrl, ?array
4343
throw new InvalidTokenError("Token introspection failed: HTTP {$response->getStatusCode()}");
4444
}
4545

46-
$body = (string)$response->getBody();
46+
$body = (string) $response->getBody();
4747
$data = \json_decode($body, true);
4848

4949
if (\json_last_error() !== JSON_ERROR_NONE) {
@@ -79,7 +79,7 @@ public function getUserInfo(string $token, string $userinfoUrl): array
7979
throw new InvalidTokenError("User info request failed: HTTP {$response->getStatusCode()}");
8080
}
8181

82-
$body = (string)$response->getBody();
82+
$body = (string) $response->getBody();
8383
$data = \json_decode($body, true);
8484

8585
if (\json_last_error() !== JSON_ERROR_NONE) {

0 commit comments

Comments
 (0)