diff --git a/CHANGELOG.md b/CHANGELOG.md index b5435cb..7243863 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -154,6 +154,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 became a `function.alreadyNarrowedType` tautology once the shape was in place (PHP itself enforces the `int` via the `setLeeway` signature under `declare(strict_types=1)`). +- Collapsed multi-line `@param` / `@return` descriptions in + `OpenIdConfigurationProvider` and the test suite onto single + lines. `phpdoc_align: vertical` (the @Symfony preset default) + doesn't *create* the wraps — it just aligns whatever multi-line + structure already exists in the source, so a one-time manual + flatten gives the cleaner format and Symfony's vertical + alignment then pads description columns into a tidy table: + + * @param string|null $postLogoutRedirectUri The URL … + * @param string|null $state If a state … + * @param string|null $idToken The id token + + Future docblocks added with everything on one line stay that + way under the same alignment rule. - PHPStan now scans `tests/` in addition to `src/` at level 8, with `reportIgnoresWithoutComments: true` so unexplained `@phpstan-ignore` directives fail CI. diff --git a/src/Security/OpenIdConfigurationProvider.php b/src/Security/OpenIdConfigurationProvider.php index 62adf40..a777a82 100644 --- a/src/Security/OpenIdConfigurationProvider.php +++ b/src/Security/OpenIdConfigurationProvider.php @@ -169,15 +169,11 @@ public function getAuthorizationUrl(array $options = []): string * @see https://docs.microsoft.com/en-us/azure/active-directory-b2c/openid-connect#send-a-sign-out-request * @see https://openid.net/specs/openid-connect-rpinitiated-1_0.html#RPLogout * - * @param string|null $postLogoutRedirectUri - * The URL that the user should be redirected to after successful sign out - * @param string|null $state - * If a state parameter is included in the request, the same value should appear in the response. The application should verify that the state values in the request and response are identical. - * @param string|null $idToken - * The id token + * @param string|null $postLogoutRedirectUri The URL that the user should be redirected to after successful sign out + * @param string|null $state If a state parameter is included in the request, the same value should appear in the response. The application should verify that the state values in the request and response are identical. + * @param string|null $idToken The id token * - * @return string - * The Url to redirect the client to for session logout + * @return string The Url to redirect the client to for session logout * * @throws CacheException * @throws HttpException @@ -220,13 +216,10 @@ public function getEndSessionUrl(?string $postLogoutRedirectUri = null, ?string * processes), the leeway value set by the last provider to call validateIdToken() * will apply globally until overwritten. * - * @param string $idToken - * Raw id token - * @param string $nonce - * Nonce + * @param string $idToken Raw id token + * @param string $nonce Nonce * - * @return object - * The JWT's payload as a PHP object + * @return object The JWT's payload as a PHP object * * @throws CacheException * @throws ClaimsException @@ -268,11 +261,9 @@ public function validateIdToken(string $idToken, string $nonce): object /** * Get id token from code. * - * @param string $code - * The code + * @param string $code The code * - * @return string - * The ID token + * @return string The ID token * * @throws OpenIdConnectExceptionInterface */ @@ -310,11 +301,9 @@ public function getIdToken(string $code): string * Generates a new random string to use as the state parameter in an * authorization flow. * - * @param int $length - * Length of the random string to be generated + * @param int $length Length of the random string to be generated * - * @return string - * The generated state + * @return string The generated state */ public function generateState(int $length = 32): string { @@ -327,11 +316,9 @@ public function generateState(int $length = 32): string * Generates a new random string to use as the nonce parameter in an * authorization flow. * - * @param int $length - * Length of the random string to be generated + * @param int $length Length of the random string to be generated * - * @return string - * The generated nonce + * @return string The generated nonce */ public function generateNonce(int $length = 32): string { @@ -379,8 +366,7 @@ protected function createResourceOwner(array $response, AccessToken $token): Res /** * Get JWT verification keys from Azure Active Directory. * - * @return array - * Array of keys indexed by JWK `kid` + * @return array Array of keys indexed by JWK `kid` * * @throws OpenIdConnectExceptionInterface */ @@ -459,8 +445,7 @@ private static function base64urlDecode(string $input): string /** * Fetch remote json resource. * - * @return array - * Json decoded to array + * @return array Json decoded to array * * @throws HttpException * @throws JsonException @@ -490,11 +475,9 @@ private function fetchJsonResource(string $resourceUrl): array /** * Get Configuration option for key. * - * @param string $key - * The configuration key + * @param string $key The configuration key * - * @return string - * The configuration value for the given key + * @return string The configuration value for the given key * * @throws CacheException * @throws HttpException @@ -550,8 +533,7 @@ private function setCacheItemPool(CacheItemPoolInterface $cacheItemPool): void /** * Set the provider cache duration. * - * @param int $cacheDuration - * The cache duration in seconds + * @param int $cacheDuration The cache duration in seconds * * @throws NegativeCacheDurationException */ @@ -566,8 +548,7 @@ private function setCacheDuration(int $cacheDuration): void /** * Set the leeway to allow for clock skew between hosting server and provider. * - * @param int $leeway - * The leeway in seconds. Must be positive + * @param int $leeway The leeway in seconds. Must be positive * * @throws NegativeLeewayException */ @@ -582,8 +563,7 @@ private function setLeeway(int $leeway): void /** * Set allow HTTP. * - * @param bool $allowHttp - * Whether to allow HTTP + * @param bool $allowHttp Whether to allow HTTP */ private function setAllowHttp(bool $allowHttp): void { diff --git a/tests/Security/OpenIdConfigurationProviderTest.php b/tests/Security/OpenIdConfigurationProviderTest.php index 30541fb..9bffc5d 100644 --- a/tests/Security/OpenIdConfigurationProviderTest.php +++ b/tests/Security/OpenIdConfigurationProviderTest.php @@ -1073,8 +1073,7 @@ public function testBase64urlDecodeFailure(): void /** * Get a mock success response with mock date. * - * @return ResponseInterface - * A success ("200") response with mock body data + * @return ResponseInterface A success ("200") response with mock body data */ /** * Load a JSON fixture from tests/MockData and decode it as an associative