Skip to content

Commit 6322066

Browse files
authored
Merge branch 'master' into fix/authorization-code-error-redirect
2 parents b637211 + 44272ff commit 6322066

File tree

52 files changed

+292
-288
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+292
-288
lines changed

docker-compose.yml renamed to compose.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
version: '3'
21
services:
32
php:
43
build: ./dev/docker

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"ext-openssl": "*",
2121
"doctrine/doctrine-bundle": "^2.8.0",
2222
"doctrine/orm": "^2.14|^3.0",
23-
"league/oauth2-server": "^8.3",
23+
"league/oauth2-server": "^9",
2424
"nyholm/psr7": "^1.4",
2525
"psr/http-factory": "^1.0",
2626
"symfony/event-dispatcher": "^5.4|^6.2|^7.0",
@@ -47,7 +47,7 @@
4747
},
4848
"extra": {
4949
"branch-alias": {
50-
"dev-master": "0.4-dev"
50+
"dev-master": "0.9-dev"
5151
}
5252
},
5353
"minimum-stability": "dev"

dev/bin/docker-compose

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ set -e
55
export HOST_USER_ID=$(id -u)
66
export HOST_GROUP_ID=$(id -g)
77

8-
docker-compose "$@"
8+
docker compose "$@"

src/Command/ClearExpiredTokensCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
103103
private function clearExpiredAccessTokens(SymfonyStyle $io): void
104104
{
105105
$numOfClearedAccessTokens = $this->accessTokenManager->clearExpired();
106-
$io->success(sprintf(
106+
$io->success(\sprintf(
107107
'Cleared %d expired access token%s.',
108108
$numOfClearedAccessTokens,
109109
1 === $numOfClearedAccessTokens ? '' : 's'
@@ -113,7 +113,7 @@ private function clearExpiredAccessTokens(SymfonyStyle $io): void
113113
private function clearExpiredRefreshTokens(SymfonyStyle $io): void
114114
{
115115
$numOfClearedRefreshTokens = $this->refreshTokenManager->clearExpired();
116-
$io->success(sprintf(
116+
$io->success(\sprintf(
117117
'Cleared %d expired refresh token%s.',
118118
$numOfClearedRefreshTokens,
119119
1 === $numOfClearedRefreshTokens ? '' : 's'
@@ -123,7 +123,7 @@ private function clearExpiredRefreshTokens(SymfonyStyle $io): void
123123
private function clearExpiredAuthCodes(SymfonyStyle $io): void
124124
{
125125
$numOfClearedAuthCodes = $this->authorizationCodeManager->clearExpired();
126-
$io->success(sprintf(
126+
$io->success(\sprintf(
127127
'Cleared %d expired auth code%s.',
128128
$numOfClearedAuthCodes,
129129
1 === $numOfClearedAuthCodes ? '' : 's'

src/Command/CreateClientCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,11 @@ private function buildClientFromInput(InputInterface $input): ClientInterface
135135
$client->setActive(true);
136136
$client->setAllowPlainTextPkce($input->getOption('allow-plain-text-pkce'));
137137

138-
/** @var list<string> $redirectUriStrings */
138+
/** @var list<non-empty-string> $redirectUriStrings */
139139
$redirectUriStrings = $input->getOption('redirect-uri');
140-
/** @var list<string> $grantStrings */
140+
/** @var list<non-empty-string> $grantStrings */
141141
$grantStrings = $input->getOption('grant-type');
142-
/** @var list<string> $scopeStrings */
142+
/** @var list<non-empty-string> $scopeStrings */
143143
$scopeStrings = $input->getOption('scope');
144144

145145
return $client

src/Command/DeleteClientCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
4444
$io = new SymfonyStyle($input, $output);
4545

4646
if (null === $client = $this->clientManager->find($input->getArgument('identifier'))) {
47-
$io->error(sprintf('OAuth2 client identified as "%s" does not exist.', $input->getArgument('identifier')));
47+
$io->error(\sprintf('OAuth2 client identified as "%s" does not exist.', $input->getArgument('identifier')));
4848

4949
return 1;
5050
}

src/Command/GenerateKeyPairCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6868
$io = new SymfonyStyle($input, $output);
6969

7070
if (!\in_array($this->algorithm, self::ACCEPTED_ALGORITHMS, true)) {
71-
$io->error(sprintf('Cannot generate key pair with the provided algorithm `%s`.', $this->algorithm));
71+
$io->error(\sprintf('Cannot generate key pair with the provided algorithm `%s`.', $this->algorithm));
7272

7373
return Command::FAILURE;
7474
}
@@ -78,10 +78,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7878
if ($input->getOption('dry-run')) {
7979
$io->success('Your keys have been generated!');
8080
$io->newLine();
81-
$io->writeln(sprintf('Update your private key in <info>%s</info>:', $this->secretKey));
81+
$io->writeln(\sprintf('Update your private key in <info>%s</info>:', $this->secretKey));
8282
$io->writeln($secretKey);
8383
$io->newLine();
84-
$io->writeln(sprintf('Update your public key in <info>%s</info>:', $this->publicKey));
84+
$io->writeln(\sprintf('Update your public key in <info>%s</info>:', $this->publicKey));
8585
$io->writeln($publicKey);
8686

8787
return Command::SUCCESS;

src/Command/ListClientsCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8080

8181
private function getFindByCriteria(InputInterface $input): ClientFilter
8282
{
83-
/** @var list<string> $grantStrings */
83+
/** @var list<non-empty-string> $grantStrings */
8484
$grantStrings = $input->getOption('grant-type');
85-
/** @var list<string> $redirectUriStrings */
85+
/** @var list<non-empty-string> $redirectUriStrings */
8686
$redirectUriStrings = $input->getOption('redirect-uri');
87-
/** @var list<string> $scopeStrings */
87+
/** @var list<non-empty-string> $scopeStrings */
8888
$scopeStrings = $input->getOption('scope');
8989

9090
return ClientFilter::create()

src/Command/UpdateClientCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
5757
$io = new SymfonyStyle($input, $output);
5858

5959
if (null === $client = $this->clientManager->find($input->getArgument('identifier'))) {
60-
$io->error(sprintf('OAuth2 client identified as "%s" does not exist.', $input->getArgument('identifier')));
60+
$io->error(\sprintf('OAuth2 client identified as "%s" does not exist.', $input->getArgument('identifier')));
6161

6262
return 1;
6363
}
@@ -107,13 +107,13 @@ private function getClientActiveFromInput(InputInterface $input, bool $actual):
107107
private function getClientRelatedModelsFromInput(InputInterface $input, string $modelFqcn, array $actual, string $argument): array
108108
{
109109
/** @var list<string> $toAdd */
110-
$toAdd = $input->getOption($addArgument = sprintf('add-%s', $argument));
110+
$toAdd = $input->getOption($addArgument = \sprintf('add-%s', $argument));
111111

112112
/** @var list<string> $toRemove */
113-
$toRemove = $input->getOption($removeArgument = sprintf('remove-%s', $argument));
113+
$toRemove = $input->getOption($removeArgument = \sprintf('remove-%s', $argument));
114114

115115
if ([] !== $colliding = array_intersect($toAdd, $toRemove)) {
116-
throw new \RuntimeException(sprintf('Cannot specify "%s" in either "--%s" and "--%s".', implode('", "', $colliding), $addArgument, $removeArgument));
116+
throw new \RuntimeException(\sprintf('Cannot specify "%s" in either "--%s" and "--%s".', implode('", "', $colliding), $addArgument, $removeArgument));
117117
}
118118

119119
$filtered = array_filter($actual, static function ($model) use ($toRemove): bool {

src/Converter/UserConverter.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,17 @@
1111
final class UserConverter implements UserConverterInterface
1212
{
1313
/**
14+
* @psalm-suppress ArgumentTypeCoercion
1415
* @psalm-suppress DeprecatedMethod
1516
* @psalm-suppress UndefinedInterfaceMethod
1617
*/
17-
public function toLeague(?UserInterface $user): UserEntityInterface
18+
public function toLeague(UserInterface $user): UserEntityInterface
1819
{
1920
$userEntity = new User();
20-
if ($user instanceof UserInterface) {
21-
$userEntity->setIdentifier(method_exists($user, 'getUserIdentifier') ? $user->getUserIdentifier() : $user->getUsername());
22-
}
21+
22+
$identifier = method_exists($user, 'getUserIdentifier') ? $user->getUserIdentifier() : $user->getUsername();
23+
24+
$userEntity->setIdentifier($identifier);
2325

2426
return $userEntity;
2527
}

0 commit comments

Comments
 (0)