Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
60 changes: 20 additions & 40 deletions src/Security/OpenIdConfigurationProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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
{
Expand All @@ -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
{
Expand Down Expand Up @@ -379,8 +366,7 @@ protected function createResourceOwner(array $response, AccessToken $token): Res
/**
* Get JWT verification keys from Azure Active Directory.
*
* @return array<string, Key>
* Array of keys indexed by JWK `kid`
* @return array<string, Key> Array of keys indexed by JWK `kid`
*
* @throws OpenIdConnectExceptionInterface
*/
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
*/
Expand All @@ -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
*/
Expand All @@ -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
{
Expand Down
3 changes: 1 addition & 2 deletions tests/Security/OpenIdConfigurationProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading