Skip to content

Commit

Permalink
Merge pull request #14 from marcriemer/analysis-kYbjYy
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
marcriemer authored May 26, 2024
2 parents 58cbe2a + 9113224 commit c0d74c6
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 17 deletions.
1 change: 0 additions & 1 deletion src/ClaimExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ public function __construct(array $claimSets = [])
}

/**
*
* @return $this
*
* @throws \InvalidArgumentException
Expand Down
2 changes: 1 addition & 1 deletion src/ClaimExtractorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface ClaimExtractorInterface
* For given scopes and aggregated claims get all claims that have been configured on the extractor.
*
* @param array<int, ScopeEntityInterface> $scopes
* @param array<string, string> $claims
* @param array<string, string> $claims
*
* @return array<string, string>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Entities/ClaimSetEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ClaimSetEntry implements ClaimSetEntryInterface
/**
* Summary of __construct
*
* @param string $scope Scope of the claimset
* @param string $scope Scope of the claimset
* @param string[] $claims The claims
*/
public function __construct(
Expand Down
1 change: 0 additions & 1 deletion src/IdTokenClaimsCreatedEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ final class IdTokenClaimsCreatedEvent extends IdTokenEvent
{
/**
* Builder
*
*/
private Builder $builder;

Expand Down
2 changes: 0 additions & 2 deletions src/IdTokenIssuedEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ final class IdTokenIssuedEvent extends IdTokenEvent
{
/**
* Token
*
*/
private Token $token;

/**
* Get Token
*
*/
public function getToken(): Token
{
Expand Down
4 changes: 0 additions & 4 deletions src/ResponseTypes/IdTokenResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,16 @@ class IdTokenResponse extends BearerTokenResponse

/**
* IdTokenRepositoryInterface
*
*/
protected IdTokenRepositoryInterface $idTokenRepository;

/**
* ClaimSetRepositoryInterface
*
*/
protected ClaimSetRepositoryInterface $claimRepository;

/**
* ClaimExtractorInterface
*
*/
protected ClaimExtractorInterface $extractor;

Expand Down Expand Up @@ -111,7 +108,6 @@ protected function getExtraParams(AccessTokenEntityInterface $accessToken): arra
* Return true If this is an OpenID request
*
* @param ScopeEntityInterface[] $scopes
*
*/
private static function isOpenIDRequest(array $scopes): bool
{
Expand Down
14 changes: 7 additions & 7 deletions tests/ResponseTypes/BearerResponseTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,9 @@ public function getClaimSetEntry(AccessTokenEntityInterface $accessToken): Claim
public string $scope = 'openid';

/**
* @var array<string, string> $claims
* @var array<string, string>
*/
public array $claims = ["acr" => "pop"];
public array $claims = ['acr' => 'pop'];

public function getScope(): string
{
Expand All @@ -348,15 +348,15 @@ public function getClaims(): array
}
};

$IdTokenRepository = (new class () implements IdTokenRepositoryInterface{
$IdTokenRepository = (new class () implements IdTokenRepositoryInterface {
public function getBuilder(AccessTokenEntityInterface $accessToken): Builder
{
$builder = (new TokenBuilder(
new JoseEncoder(),
ChainedFormatter::withUnixTimestampDates()
))
->permittedFor($accessToken->getClient()->getIdentifier())
->issuedBy("https://example.com")
->issuedBy('https://example.com')
->issuedAt(new DateTimeImmutable())
->expiresAt($accessToken->getExpiryDateTime())
->relatedTo($accessToken->getUserIdentifier())
Expand Down Expand Up @@ -420,7 +420,7 @@ public function getBuilder(AccessTokenEntityInterface $accessToken): Builder
$json = json_decode($response->getBody()->getContents());
$this->assertEquals('Bearer', $json->token_type);

foreach (['expires_in', "access_token", "refresh_token", "id_token"] as $claim) {
foreach (['expires_in', 'access_token', 'refresh_token', 'id_token'] as $claim) {
self::assertTrue(property_exists($json, $claim));
}

Expand All @@ -435,7 +435,7 @@ public function getBuilder(AccessTokenEntityInterface $accessToken): Builder

$this->assertTrue($validator->validate(
$token,
new IssuedBy("https://example.com")
new IssuedBy('https://example.com')
));

$this->assertTrue($validator->validate(
Expand All @@ -453,7 +453,7 @@ public function getBuilder(AccessTokenEntityInterface $accessToken): Builder
new LooseValidAt(new SystemClock($accessToken->getExpiryDateTime()->getTimezone()))
));

$this->assertTrue($validator->validate($token, new HasClaimWithValue("acr", "pop")));
$this->assertTrue($validator->validate($token, new HasClaimWithValue('acr', 'pop')));
$this->assertTrue($validator->validate($token, new HasClaimWithValue('nonce', 's6G31Kolwu9p')));
}
}

0 comments on commit c0d74c6

Please sign in to comment.