Skip to content

Commit 957ce83

Browse files
committed
fixed linter
1 parent 2333751 commit 957ce83

File tree

4 files changed

+28
-29
lines changed

4 files changed

+28
-29
lines changed

src/SDK/API.php

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class API
2020
/**
2121
* Constructor for API class.
2222
*
23-
* @param string $projectId
23+
* @param string $projectId
2424
* @param string|null $managementKey Management key for authentication.
2525
*/
2626
public function __construct(string $projectId, ?string $managementKey)
@@ -52,7 +52,7 @@ public function __construct(string $projectId, ?string $managementKey)
5252
* This function ensures that empty arrays in the input data are
5353
* converted to empty objects (stdClass) before being JSON encoded.
5454
*
55-
* @param mixed $data The data to transform, which can be an array or any other type.
55+
* @param mixed $data The data to transform, which can be an array or any other type.
5656
* @return mixed The transformed data with empty arrays replaced by empty objects.
5757
*/
5858
private function transformEmptyArraysToObjects($data)
@@ -76,9 +76,9 @@ private function transformEmptyArraysToObjects($data)
7676
/**
7777
* Requests JwtResponse from Descope APIs with the given body and auth token.
7878
*
79-
* @param string $uri URI endpoint.
80-
* @param array $body Request body.
81-
* @param bool $useManagementKey Whether to use the management key for authentication.
79+
* @param string $uri URI endpoint.
80+
* @param array $body Request body.
81+
* @param bool $useManagementKey Whether to use the management key for authentication.
8282
* @return array JWT response array.
8383
* @throws AuthException|GuzzleException|\JsonException If the request fails.
8484
*/
@@ -130,8 +130,8 @@ public function doPost(string $uri, array $body, ?bool $useManagementKey = false
130130
/**
131131
* Sends a GET request to the specified URI with an optional auth token.
132132
*
133-
* @param string $uri URI endpoint.
134-
* @param bool $useManagementKey Whether to use the management key for authentication.
133+
* @param string $uri URI endpoint.
134+
* @param bool $useManagementKey Whether to use the management key for authentication.
135135
* @return array JWT response array.
136136
* @throws AuthException|GuzzleException|\JsonException If the request fails.
137137
*/
@@ -178,7 +178,7 @@ public function doGet(string $uri, bool $useManagementKey, ?string $refreshToken
178178
/**
179179
* Sends a DELETE request to the specified URI with an auth token.
180180
*
181-
* @param string $uri URI endpoint.
181+
* @param string $uri URI endpoint.
182182
* @return array JWT response array.
183183
* @throws AuthException|GuzzleException|\JsonException If the request fails.
184184
*/
@@ -219,9 +219,9 @@ public function doDelete(string $uri): array
219219
/**
220220
* Generates a JWT response array with the given parameters.
221221
*
222-
* @param array $responseBody
223-
* @param string|null $refreshToken Refresh token.
224-
* @param string|null $audience Audience.
222+
* @param array $responseBody
223+
* @param string|null $refreshToken Refresh token.
224+
* @param string|null $audience Audience.
225225
* @return array JWT response array.
226226
*/
227227
public function generateJwtResponse(array $responseBody, ?string $refreshToken = null, ?string $audience = null): array
@@ -237,7 +237,7 @@ public function generateJwtResponse(array $responseBody, ?string $refreshToken =
237237
/**
238238
* Generates headers for the HTTP request.
239239
*
240-
* @param string|null $authToken Authentication token.
240+
* @param string|null $authToken Authentication token.
241241
* @return array Headers array.
242242
*/
243243
private function getHeaders(string $authToken): array
@@ -255,7 +255,7 @@ private function getHeaders(string $authToken): array
255255
/**
256256
* Constructs the auth token based on whether the management key is used.
257257
*
258-
* @param bool $useManagementKey Whether to use the management key for authentication.
258+
* @param bool $useManagementKey Whether to use the management key for authentication.
259259
* @return string The constructed auth token.
260260
*/
261261
private function getAuthToken(bool $useManagementKey, ?string $refreshToken = null): string
@@ -277,12 +277,12 @@ private function getAuthToken(bool $useManagementKey, ?string $refreshToken = nu
277277
* This method processes the response body to extract JWTs, session data,
278278
* and cookie settings, and adjusts properties based on the token type.
279279
*
280-
* @param array $responseBody The API response body containing JWTs and user data.
281-
* @param string|null $refreshToken Optional refresh token.
282-
* @param bool $userJwt Indicates if user-related JWT information should be processed.
283-
* @param string|null $audience Optional audience identifier.
280+
* @param array $responseBody The API response body containing JWTs and user data.
281+
* @param string|null $refreshToken Optional refresh token.
282+
* @param bool $userJwt Indicates if user-related JWT information should be processed.
283+
* @param string|null $audience Optional audience identifier.
284284
* @return array The structured JWT response array containing session and user data.
285-
*/
285+
*/
286286
private function generateAuthInfo(array $responseBody, ?string $refreshToken, bool $userJwt, ?string $audience): array
287287
{
288288
$jwtResponse = [];
@@ -320,10 +320,10 @@ private function generateAuthInfo(array $responseBody, ?string $refreshToken, bo
320320
* This method sets permissions, roles, and tenant data from the JWT
321321
* and processes the issuer and subject values to extract project and user IDs.
322322
*
323-
* @param array $jwtResponse The JWT response array to adjust.
324-
* @param bool $userJwt Indicates if user-related JWT information should be processed.
323+
* @param array $jwtResponse The JWT response array to adjust.
324+
* @param bool $userJwt Indicates if user-related JWT information should be processed.
325325
* @return array The adjusted JWT response array with updated properties.
326-
*/
326+
*/
327327
private function adjustProperties(array $jwtResponse, bool $userJwt): array
328328
{
329329
if (isset($jwtResponse[EndpointsV1::$SESSION_TOKEN_NAME])) {

src/SDK/Auth/SSO.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function signIn(?string $tenant = null, ?string $redirectUrl = null, ?str
6161
/**
6262
* Exchanges SSO code for authentication.
6363
*
64-
* @param string|null $code The exchange code.
64+
* @param string|null $code The exchange code.
6565
* @return array Response array.
6666
*/
6767
public function exchangeToken(?string $code = null): array
@@ -77,9 +77,9 @@ public function exchangeToken(?string $code = null): array
7777
/**
7878
* Composes the SSO sign-in URL.
7979
*
80-
* @param string|null $tenant Tenant identifier.
81-
* @param string|null $redirectUrl Redirect URL.
82-
* @param string|null $prompt Prompt parameter.
80+
* @param string|null $tenant Tenant identifier.
81+
* @param string|null $redirectUrl Redirect URL.
82+
* @param string|null $prompt Prompt parameter.
8383
* @return string Composed URL.
8484
*/
8585
private function composeSignInUrl(?string $tenant, ?string $redirectUrl, ?string $prompt): string
@@ -104,7 +104,7 @@ private function composeSignInUrl(?string $tenant, ?string $redirectUrl, ?string
104104
/**
105105
* Validates the tenant parameter.
106106
*
107-
* @param string|null $tenant The tenant identifier.
107+
* @param string|null $tenant The tenant identifier.
108108
* @throws AuthException
109109
*/
110110
private function validateTenant(?string $tenant): void
@@ -117,7 +117,7 @@ private function validateTenant(?string $tenant): void
117117
/**
118118
* Validates the redirect URL parameter.
119119
*
120-
* @param string|null $redirectUrl The redirect URL.
120+
* @param string|null $redirectUrl The redirect URL.
121121
* @throws AuthException
122122
*/
123123
private function validateRedirectUrl(?string $redirectUrl): void

src/SDK/Management/Role.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,4 @@ public function validateTenantRoles(array $jwtResponse, string $tenant, array $r
9191

9292
return empty(array_diff($roles, $grantedRoles));
9393
}
94-
9594
}

src/tests/DescopeSDKTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ public function testRefreshSessionThrowsExceptionWithoutToken()
3737
$this->expectException(\InvalidArgumentException::class);
3838
$this->sdk->refreshSession(null);
3939
}
40-
}
40+
}

0 commit comments

Comments
 (0)