Skip to content

Commit d7cb055

Browse files
theofidrychalasr
authored andcommitted
style: Apply PHP-CS-Fixer
1 parent 1d105df commit d7cb055

24 files changed

+7
-136
lines changed

src/DBAL/Type/Grant.php

-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ final class Grant extends ImplodedArray
1616
*/
1717
private const NAME = 'oauth2_grant';
1818

19-
/**
20-
* {@inheritdoc}
21-
*/
2219
public function getName(): string
2320
{
2421
return self::NAME;

src/DBAL/Type/ImplodedArray.php

-10
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform): ?str
3939
}
4040

4141
/**
42-
* {@inheritdoc}
43-
*
44-
* @param mixed $value
45-
*
4642
* @psalm-return list<T>
4743
*/
4844
public function convertToPHPValue($value, AbstractPlatform $platform): array
@@ -58,19 +54,13 @@ public function convertToPHPValue($value, AbstractPlatform $platform): array
5854
return $this->convertDatabaseValues($values);
5955
}
6056

61-
/**
62-
* {@inheritdoc}
63-
*/
6457
public function getSQLDeclaration(array $column, AbstractPlatform $platform): string
6558
{
6659
$column['length'] = 65535;
6760

6861
return parent::getSQLDeclaration($column, $platform);
6962
}
7063

71-
/**
72-
* {@inheritdoc}
73-
*/
7464
public function requiresSQLCommentHint(AbstractPlatform $platform): bool
7565
{
7666
return true;

src/DBAL/Type/RedirectUri.php

-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ final class RedirectUri extends ImplodedArray
1616
*/
1717
private const NAME = 'oauth2_redirect_uri';
1818

19-
/**
20-
* {@inheritdoc}
21-
*/
2219
public function getName(): string
2320
{
2421
return self::NAME;

src/DBAL/Type/Scope.php

-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ final class Scope extends ImplodedArray
1616
*/
1717
private const NAME = 'oauth2_scope';
1818

19-
/**
20-
* {@inheritdoc}
21-
*/
2219
public function getName(): string
2320
{
2421
return self::NAME;

src/DependencyInjection/Configuration.php

-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313

1414
final class Configuration implements ConfigurationInterface
1515
{
16-
/**
17-
* {@inheritdoc}
18-
*/
1916
public function getConfigTreeBuilder(): TreeBuilder
2017
{
2118
$treeBuilder = new TreeBuilder('league_oauth2_server');

src/DependencyInjection/LeagueOAuth2ServerExtension.php

-9
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@
4242
final class LeagueOAuth2ServerExtension extends Extension implements PrependExtensionInterface, CompilerPassInterface
4343
{
4444
/**
45-
* {@inheritdoc}
46-
*
4745
* @return void
4846
*
4947
* @throws \Exception
@@ -73,17 +71,12 @@ public function load(array $configs, ContainerBuilder $container)
7371
;
7472
}
7573

76-
/**
77-
* {@inheritdoc}
78-
*/
7974
public function getAlias(): string
8075
{
8176
return 'league_oauth2_server';
8277
}
8378

8479
/**
85-
* {@inheritdoc}
86-
*
8780
* @return void
8881
*/
8982
public function prepend(ContainerBuilder $container)
@@ -101,8 +94,6 @@ public function prepend(ContainerBuilder $container)
10194
}
10295

10396
/**
104-
* {@inheritdoc}
105-
*
10697
* @return void
10798
*/
10899
public function process(ContainerBuilder $container)

src/Entity/Scope.php

-5
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ final class Scope implements ScopeEntityInterface
1111
{
1212
use EntityTrait;
1313

14-
/**
15-
* {@inheritdoc}
16-
*
17-
* @return mixed
18-
*/
1914
#[\ReturnTypeWillChange]
2015
public function jsonSerialize()
2116
{

src/LeagueOAuth2ServerBundle.php

-5
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
final class LeagueOAuth2ServerBundle extends Bundle
1919
{
2020
/**
21-
* {@inheritdoc}
22-
*
2321
* @return void
2422
*/
2523
public function build(ContainerBuilder $container)
@@ -30,9 +28,6 @@ public function build(ContainerBuilder $container)
3028
$this->configureSecurityExtension($container);
3129
}
3230

33-
/**
34-
* {@inheritdoc}
35-
*/
3631
public function getContainerExtension(): ExtensionInterface
3732
{
3833
return new LeagueOAuth2ServerExtension();

src/Model/RefreshToken.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class RefreshToken implements RefreshTokenInterface
2929
/**
3030
* @psalm-mutation-free
3131
*/
32-
public function __construct(string $identifier, \DateTimeInterface $expiry, ?AccessTokenInterface $accessToken = null)
32+
public function __construct(string $identifier, \DateTimeInterface $expiry, AccessTokenInterface $accessToken = null)
3333
{
3434
$this->identifier = $identifier;
3535
$this->expiry = $expiry;

src/Repository/AccessTokenRepository.php

-6
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ public function __construct(
4242
$this->scopeConverter = $scopeConverter;
4343
}
4444

45-
/**
46-
* {@inheritdoc}
47-
*/
4845
public function getNewToken(ClientEntityInterface $clientEntity, array $scopes, $userIdentifier = null)
4946
{
5047
/** @var int|string|null $userIdentifier */
@@ -59,9 +56,6 @@ public function getNewToken(ClientEntityInterface $clientEntity, array $scopes,
5956
return $accessToken;
6057
}
6158

62-
/**
63-
* {@inheritdoc}
64-
*/
6559
public function persistNewAccessToken(AccessTokenEntityInterface $accessTokenEntity): void
6660
{
6761
$accessToken = $this->accessTokenManager->find($accessTokenEntity->getIdentifier());

src/Repository/AuthCodeRepository.php

-11
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,12 @@ public function __construct(
4141
$this->scopeConverter = $scopeConverter;
4242
}
4343

44-
/**
45-
* {@inheritdoc}
46-
*/
4744
public function getNewAuthCode(): AuthCode
4845
{
4946
return new AuthCode();
5047
}
5148

5249
/**
53-
* {@inheritdoc}
54-
*
5550
* @return void
5651
*/
5752
public function persistNewAuthCode(AuthCodeEntityInterface $authCodeEntity)
@@ -67,9 +62,6 @@ public function persistNewAuthCode(AuthCodeEntityInterface $authCodeEntity)
6762
$this->authorizationCodeManager->save($authorizationCode);
6863
}
6964

70-
/**
71-
* {@inheritdoc}
72-
*/
7365
public function revokeAuthCode($codeId): void
7466
{
7567
$authorizationCode = $this->authorizationCodeManager->find($codeId);
@@ -83,9 +75,6 @@ public function revokeAuthCode($codeId): void
8375
$this->authorizationCodeManager->save($authorizationCode);
8476
}
8577

86-
/**
87-
* {@inheritdoc}
88-
*/
8978
public function isAuthCodeRevoked($codeId): bool
9079
{
9180
$authorizationCode = $this->authorizationCodeManager->find($codeId);

src/Repository/ClientRepository.php

-6
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ public function __construct(ClientManagerInterface $clientManager)
2121
$this->clientManager = $clientManager;
2222
}
2323

24-
/**
25-
* {@inheritdoc}
26-
*/
2724
public function getClientEntity($clientIdentifier)
2825
{
2926
$client = $this->clientManager->find($clientIdentifier);
@@ -35,9 +32,6 @@ public function getClientEntity($clientIdentifier)
3532
return $this->buildClientEntity($client);
3633
}
3734

38-
/**
39-
* {@inheritdoc}
40-
*/
4135
public function validateClient($clientIdentifier, $clientSecret, $grantType): bool
4236
{
4337
$client = $this->clientManager->find($clientIdentifier);

src/Repository/NullAccessTokenRepository.php

-12
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111

1212
final class NullAccessTokenRepository implements AccessTokenRepositoryInterface
1313
{
14-
/**
15-
* {@inheritdoc}
16-
*/
1714
public function getNewToken(ClientEntityInterface $clientEntity, array $scopes, $userIdentifier = null): AccessTokenEntityInterface
1815
{
1916
/** @var int|string|null $userIdentifier */
@@ -28,25 +25,16 @@ public function getNewToken(ClientEntityInterface $clientEntity, array $scopes,
2825
return $accessToken;
2926
}
3027

31-
/**
32-
* {@inheritdoc}
33-
*/
3428
public function persistNewAccessToken(AccessTokenEntityInterface $accessTokenEntity): void
3529
{
3630
// do nothing
3731
}
3832

39-
/**
40-
* {@inheritdoc}
41-
*/
4233
public function revokeAccessToken($tokenId): void
4334
{
4435
// do nothing
4536
}
4637

47-
/**
48-
* {@inheritdoc}
49-
*/
5038
public function isAccessTokenRevoked($tokenId): bool
5139
{
5240
return false;

src/Repository/RefreshTokenRepository.php

-6
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,11 @@ public function __construct(
3232
$this->accessTokenManager = $accessTokenManager;
3333
}
3434

35-
/**
36-
* {@inheritdoc}
37-
*/
3835
public function getNewRefreshToken()
3936
{
4037
return new RefreshTokenEntity();
4138
}
4239

43-
/**
44-
* {@inheritdoc}
45-
*/
4640
public function persistNewRefreshToken(RefreshTokenEntityInterface $refreshTokenEntity): void
4741
{
4842
$refreshToken = $this->refreshTokenManager->find($refreshTokenEntity->getIdentifier());

src/Repository/ScopeRepository.php

-3
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ public function __construct(
5252
$this->eventDispatcher = $eventDispatcher;
5353
}
5454

55-
/**
56-
* {@inheritdoc}
57-
*/
5855
public function getScopeEntityByIdentifier($identifier)
5956
{
6057
$scope = $this->scopeManager->find($identifier);

src/Repository/UserRepository.php

-3
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ public function __construct(
4242
$this->userConverter = $userConverter;
4343
}
4444

45-
/**
46-
* {@inheritdoc}
47-
*/
4845
public function getUserEntityByUserCredentials(
4946
$username,
5047
$password,

src/Security/Authenticator/OAuth2Authenticator.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function __construct(
7070

7171
public function supports(Request $request): ?bool
7272
{
73-
return 0 === strpos($request->headers->get('Authorization', ''), 'Bearer ');
73+
return str_starts_with($request->headers->get('Authorization', ''), 'Bearer ');
7474
}
7575

7676
public function start(Request $request, AuthenticationException $authException = null): Response
@@ -79,8 +79,6 @@ public function start(Request $request, AuthenticationException $authException =
7979
}
8080

8181
/**
82-
* {@inheritdoc}
83-
*
8482
* @return Passport
8583
*/
8684
public function doAuthenticate(Request $request) /* : Passport */

src/Security/Exception/InsufficientScopesException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010
class InsufficientScopesException extends OAuth2AuthenticationException
1111
{
12-
public static function create(?\Throwable $previous = null): self
12+
public static function create(\Throwable $previous = null): self
1313
{
1414
return new self('Insufficient scopes.', 403, $previous);
1515
}

src/Security/Exception/OAuth2AuthenticationException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class OAuth2AuthenticationException extends AuthenticationException implements H
1717
*/
1818
private $statusCode;
1919

20-
public function __construct(string $message, int $statusCode, ?\Throwable $previous = null)
20+
public function __construct(string $message, int $statusCode, \Throwable $previous = null)
2121
{
2222
$this->statusCode = $statusCode;
2323

src/Security/Exception/OAuth2AuthenticationFailedException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010
class OAuth2AuthenticationFailedException extends OAuth2AuthenticationException
1111
{
12-
public static function create(string $message, ?\Throwable $previous = null): self
12+
public static function create(string $message, \Throwable $previous = null): self
1313
{
1414
return new self($message, 401, $previous);
1515
}

tests/Acceptance/DoctrineCredentialsRevokerTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ private function buildRefreshToken(string $identifier, string $modify, AccessTok
9090
);
9191
}
9292

93-
private function buildAccessToken(string $identifier, string $modify, Client $client, ?string $userIdentifier = null): AccessToken
93+
private function buildAccessToken(string $identifier, string $modify, Client $client, string $userIdentifier = null): AccessToken
9494
{
9595
return new AccessToken(
9696
$identifier,
@@ -101,7 +101,7 @@ private function buildAccessToken(string $identifier, string $modify, Client $cl
101101
);
102102
}
103103

104-
private function buildAuthCode(string $identifier, string $modify, Client $client, ?string $userIdentifier = null): AuthorizationCode
104+
private function buildAuthCode(string $identifier, string $modify, Client $client, string $userIdentifier = null): AuthorizationCode
105105
{
106106
return new AuthorizationCode(
107107
$identifier,

0 commit comments

Comments
 (0)