Skip to content

Commit

Permalink
Update & fix CS
Browse files Browse the repository at this point in the history
  • Loading branch information
stloyd committed Jul 21, 2022
1 parent cd2c0a0 commit fd12513
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/OAuth/ResourceOwner/AppleResourceOwner.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ protected function configureOptions(OptionsResolver $resolver)

private static function jwtDecode(string $idToken)
{
//// from http://stackoverflow.com/a/28748285/624544
// from http://stackoverflow.com/a/28748285/624544
[, $jwt] = explode('.', $idToken, 3);

// if the token was urlencoded, do some fixes to ensure that it is valid base64 encoded
Expand Down
2 changes: 1 addition & 1 deletion src/OAuth/ResourceOwner/AzureResourceOwner.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function configure()
public function getUserInformation(array $accessToken, array $extraParameters = [])
{
// from http://stackoverflow.com/a/28748285/624544
[, $jwt] = explode('.', (\array_key_exists('id_token', $accessToken) ? $accessToken['id_token'] : $accessToken['access_token']), 3);
[, $jwt] = explode('.', \array_key_exists('id_token', $accessToken) ? $accessToken['id_token'] : $accessToken['access_token'], 3);

// if the token was urlencoded, do some fixes to ensure that it is valid base64 encoded
$jwt = str_replace(['-', '_'], ['+', '/'], $jwt);
Expand Down
6 changes: 3 additions & 3 deletions src/OAuth/ResourceOwner/KeycloakResourceOwner.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ protected function configureOptions(OptionsResolver $resolver)

$normalizer = function (Options $options, $value) {
return str_replace(
'{keycloak_url}',
$options['base_url'].'/realms/'.$options['realm'].'/protocol/'.$options['protocol'],
$value
'{keycloak_url}',
$options['base_url'].'/realms/'.$options['realm'].'/protocol/'.$options['protocol'],
$value
);
};

Expand Down
2 changes: 1 addition & 1 deletion src/Security/OAuthUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public static function signRequest(

// Remove query params from URL
// Ref: Spec: 9.1.2
$url = sprintf('%s://%s%s%s', $url['scheme'], $url['host'], ($explicitPort ? ':'.$explicitPort : ''), $url['path'] ?? '');
$url = sprintf('%s://%s%s%s', $url['scheme'], $url['host'], $explicitPort ? ':'.$explicitPort : '', $url['path'] ?? '');

// Parameters are sorted by name, using lexicographical byte value ordering.
// Ref: Spec: 9.1.1 (1)
Expand Down
2 changes: 1 addition & 1 deletion tests/Security/OAuthUtilsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ private function getHttpUtils(string $generatedUrl = '/'): HttpUtils
$urlGenerator
->expects($this->any())
->method('generate')
->willReturn(($generatedUrl))
->willReturn($generatedUrl)
;

return new HttpUtils($urlGenerator);
Expand Down

0 comments on commit fd12513

Please sign in to comment.