-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/update bundle to symfony 7 #38
base: master
Are you sure you want to change the base?
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/vendor/ | ||
/.idea/ | ||
/composer.lock |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,9 +35,9 @@ public function __construct( | |
$this->defaultTargetRouteName = $defaultTargetRouteName; | ||
} | ||
|
||
public function onSymfonyComponentSecurityHttpEventLogoutEvent(LogoutEvent $event) | ||
public function onSymfonyComponentSecurityHttpEventLogoutEvent(LogoutEvent $event): void | ||
{ | ||
if (null === $event->getToken() || null === $event->getToken()->getUser()) { | ||
if (null === $event->getToken()?->getUser()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not a good idea to use the null safe operator (uncompatible with < php8) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmmm Symfony 6.4 requires >= PHP 8.1 |
||
return; | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,12 +20,12 @@ class KeycloakProvider extends AbstractProvider | |
/** | ||
* @var string use to identify the "public"" way to call the auth server | ||
*/ | ||
const MODE_PUBLIC = 'public'; | ||
private const MODE_PUBLIC = 'public'; | ||
|
||
/** | ||
* @var string use to identify the "private"" way to call the auth server | ||
*/ | ||
const MODE_PRIVATE = 'private'; | ||
private const MODE_PRIVATE = 'private'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
public ?string $authServerPublicUrl = null; | ||
|
||
|
@@ -58,17 +58,17 @@ public function decryptResponse($response): array | |
* | ||
* @return string | ||
*/ | ||
public function getBaseUrl($mode = self::MODE_PUBLIC) | ||
public function getBaseUrl(string $mode = self::MODE_PUBLIC): ?string | ||
{ | ||
return self::MODE_PRIVATE === $mode ? $this->authServerPrivateUrl : $this->authServerPublicUrl; | ||
} | ||
|
||
public function getBaseUrlWithRealm($mode) | ||
public function getBaseUrlWithRealm($mode): string | ||
{ | ||
return sprintf('%s/realms/%s', $this->getBaseUrl($mode), $this->realm); | ||
} | ||
|
||
public function getResourceOwnerManageAccountUrl() | ||
public function getResourceOwnerManageAccountUrl(): string | ||
{ | ||
return sprintf('%s/account', $this->getBaseUrlWithRealm(self::MODE_PUBLIC)); | ||
} | ||
|
@@ -103,7 +103,7 @@ public function getBaseApiUrlWithRealm(): string | |
return sprintf('%s/admin/realms/%s', $this->getBaseUrl(self::MODE_PRIVATE), $this->realm); | ||
} | ||
|
||
public function getLogoutUrl(array $options = []) | ||
public function getLogoutUrl(array $options = []): string | ||
{ | ||
$base = $this->getBaseLogoutUrl(); | ||
$params = $this->getAuthorizationParameters($options); | ||
|
@@ -128,12 +128,12 @@ public function getResourceOwner(AccessToken $token): KeycloakResourceOwner | |
return $this->createResourceOwner($response, $token); | ||
} | ||
|
||
public function getClientId() | ||
public function getClientId(): string | ||
{ | ||
return $this->clientId; | ||
} | ||
|
||
public function getClientSecret() | ||
public function getClientSecret(): string | ||
{ | ||
return $this->clientSecret; | ||
} | ||
|
@@ -148,7 +148,7 @@ protected function getScopeSeparator(): string | |
return ' '; | ||
} | ||
|
||
protected function checkResponse(ResponseInterface $response, $data) | ||
protected function checkResponse(ResponseInterface $response, $data): void | ||
{ | ||
if (!empty($data['error'])) { | ||
$error = sprintf('%s: %s', $data['error'], $data['error_description']); | ||
|
@@ -162,7 +162,7 @@ protected function createResourceOwner(array $response, AccessToken $token): Key | |
return new KeycloakResourceOwner($response, $token); | ||
} | ||
|
||
protected function getAllowedClientOptions(array $options) | ||
protected function getAllowedClientOptions(array $options): array | ||
{ | ||
return ['timeout', 'proxy', 'verify']; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,23 +19,24 @@ | |
} | ||
], | ||
"require": { | ||
"symfony/dependency-injection": "^5.3|^6.0", | ||
"symfony/framework-bundle": "^5.3|^6.0", | ||
"symfony/http-client": "^5.3|^6.0", | ||
"symfony/routing": "^5.3|^6.0", | ||
"symfony/security-bundle": "^5.3|^6.0", | ||
"symfony/http-foundation": "^5.3|^6.0", | ||
"php": ">=8.2", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://symfony.com/releases/6.4 => requirement php8.1.0 or higher |
||
"symfony/dependency-injection": "^6.4|^7.0", | ||
"symfony/framework-bundle": "^6.4|^7.0", | ||
"symfony/http-client": "^6.4|^7.0", | ||
"symfony/routing": "^6.4|^7.0", | ||
"symfony/security-bundle": "^6.4|^7.0", | ||
"symfony/http-foundation": "^6.4|^7.0", | ||
"knpuniversity/oauth2-client-bundle": "^2.0" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^6.0", | ||
"symfony/expression-language": "^5.3|^6.0", | ||
"symfony/finder": "^5.3|^6.0", | ||
"symfony/form": "^5.3|^6.0", | ||
"symfony/stopwatch": "^5.3|^6.0", | ||
"symfony/twig-bundle": "^5.3|^6.0", | ||
"symfony/validator": "^5.3|^6.0", | ||
"symfony/yaml": "^5.3|^6.0" | ||
"phpunit/phpunit": "^11", | ||
"symfony/expression-language": "^6.4|^7.0", | ||
"symfony/finder": "^6.4|^7.0", | ||
"symfony/form": "^6.4|^7.0", | ||
"symfony/stopwatch": "^6.4|^7.0", | ||
"symfony/twig-bundle": "^6.4|^7.0", | ||
"symfony/validator": "^6.4|^7.0", | ||
"symfony/yaml": "^6.4|^7.0" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Symfony 5.4 is still officially supported and for a while. I think using a BC Layer is not too expensive here. I have no idea what @konandrum thinks about this... |
||
}, | ||
"autoload": { | ||
"psr-4": { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is now useless