Skip to content

Commit ec2c2d3

Browse files
committed
Fix CS
1 parent 01ebde6 commit ec2c2d3

21 files changed

+51
-51
lines changed

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/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/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/DBAL/Type/ImplodedArray.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ private function assertValueCanBeImploded($value): void
8383
return;
8484
}
8585

86-
throw new \InvalidArgumentException(sprintf('The value of \'%s\' type cannot be imploded.', \gettype($value)));
86+
throw new \InvalidArgumentException(\sprintf('The value of \'%s\' type cannot be imploded.', \gettype($value)));
8787
}
8888

8989
/**

src/DependencyInjection/CompilerPass/EncryptionKeyPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ public function process(ContainerBuilder $container): void
4444
return;
4545
}
4646

47-
throw new \RuntimeException(sprintf('The value "%s" is not allowed for path "league_oauth2_server.authorization_server.encryption_key_type". Permissible values: "plain", "defuse"', $encryptionKeyType));
47+
throw new \RuntimeException(\sprintf('The value "%s" is not allowed for path "league_oauth2_server.authorization_server.encryption_key_type". Permissible values: "plain", "defuse"', $encryptionKeyType));
4848
}
4949
}

src/DependencyInjection/Configuration.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ private function createAuthorizationServerNode(): NodeDefinition
5555
->defaultValue(null)
5656
->end()
5757
->scalarNode('encryption_key')
58-
->info(sprintf("The plain string or the ascii safe string used to create a %s to be used as an encryption key.\nHow to generate an encryption key: https://oauth2.thephpleague.com/installation/#string-password", Key::class))
58+
->info(\sprintf("The plain string or the ascii safe string used to create a %s to be used as an encryption key.\nHow to generate an encryption key: https://oauth2.thephpleague.com/installation/#string-password", Key::class))
5959
->isRequired()
6060
->cannotBeEmpty()
6161
->end()
@@ -240,13 +240,13 @@ private function createClientNode(): NodeDefinition
240240
->addDefaultsIfNotSet()
241241
->children()
242242
->scalarNode('classname')
243-
->info(sprintf('Set a custom client class. Must be a %s', AbstractClient::class))
243+
->info(\sprintf('Set a custom client class. Must be a %s', AbstractClient::class))
244244
->defaultValue(Client::class)
245245
->validate()
246246
->ifTrue(function ($v) {
247247
return !is_a($v, AbstractClient::class, true);
248248
})
249-
->thenInvalid(sprintf('%%s must be a %s', AbstractClient::class))
249+
->thenInvalid(\sprintf('%%s must be a %s', AbstractClient::class))
250250
->end()
251251
->end()
252252
->end()

src/DependencyInjection/LeagueOAuth2ServerExtension.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ private function assertRequiredBundlesAreEnabled(ContainerBuilder $container): v
126126

127127
foreach ($requiredBundles as $bundleAlias => $requiredBundle) {
128128
if (!$container->hasExtension($bundleAlias)) {
129-
throw new \LogicException(sprintf('Bundle \'%s\' needs to be enabled in your application kernel.', $requiredBundle));
129+
throw new \LogicException(\sprintf('Bundle \'%s\' needs to be enabled in your application kernel.', $requiredBundle));
130130
}
131131
}
132132
}
@@ -260,7 +260,7 @@ private function configureDoctrinePersistence(ContainerBuilder $container, array
260260
$entityManagerName = $persistenceConfig['entity_manager'];
261261

262262
$entityManager = new Reference(
263-
sprintf('doctrine.orm.%s_entity_manager', $entityManagerName)
263+
\sprintf('doctrine.orm.%s_entity_manager', $entityManagerName)
264264
);
265265

266266
$container
@@ -339,7 +339,7 @@ private function configureScopes(ContainerBuilder $container, array $scopes): vo
339339
$defaultScopes = $scopes['default'];
340340

341341
if ([] !== $invalidDefaultScopes = array_diff($defaultScopes, $availableScopes)) {
342-
throw new \LogicException(sprintf('Invalid default scopes "%s" for path "league_oauth2_server.scopes.default". Permissible values: "%s"', implode('", "', $invalidDefaultScopes), implode('", "', $availableScopes)));
342+
throw new \LogicException(\sprintf('Invalid default scopes "%s" for path "league_oauth2_server.scopes.default". Permissible values: "%s"', implode('", "', $invalidDefaultScopes), implode('", "', $availableScopes)));
343343
}
344344

345345
$container->setParameter('league.oauth2_server.scopes.default', $defaultScopes);

src/DependencyInjection/Security/OAuth2FactoryTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function create(ContainerBuilder $container, $id, $config, $userProvider,
2323

2424
public function createAuthenticator(ContainerBuilder $container, string $firewallName, array $config, string $userProviderId): string
2525
{
26-
$authenticator = sprintf('security.authenticator.oauth2.%s', $firewallName);
26+
$authenticator = \sprintf('security.authenticator.oauth2.%s', $firewallName);
2727

2828
$definition = new ChildDefinition(OAuth2Authenticator::class);
2929
$definition->replaceArgument(2, new Reference($userProviderId));

src/Event/AuthorizationRequestResolveEventFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function fromAuthorizationRequest(AuthorizationRequest $authorizationRequ
3333
$client = $this->clientManager->find($authorizationRequest->getClient()->getIdentifier());
3434

3535
if (null === $client) {
36-
throw new \RuntimeException(sprintf('No client found for the given identifier \'%s\'.', $authorizationRequest->getClient()->getIdentifier()));
36+
throw new \RuntimeException(\sprintf('No client found for the given identifier \'%s\'.', $authorizationRequest->getClient()->getIdentifier()));
3737
}
3838

3939
return new AuthorizationRequestResolveEvent($authorizationRequest, $scopes, $client);

0 commit comments

Comments
 (0)