Skip to content
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

Apply fixes from StyleCI #14

Merged
merged 1 commit into from
May 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/ClaimExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,13 @@
}

/**
*
* @return $this
*
* @throws \InvalidArgumentException
*/
public function addClaimSet(ClaimSetEntryInterface $claimSetEntry): ClaimExtractor
{
if (in_array($claimSetEntry->getScope(), $this->protectedClaims) && !$this->getClaimSet($claimSetEntry->getScope())) {

Check failure on line 64 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-stable, ubuntu-latest)

Call to function in_array() requires parameter #3 to be set.

Check failure on line 64 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-stable, ubuntu-latest)

Only booleans are allowed in a negated boolean, League\OAuth2\Server\Entities\ClaimSetEntryInterface|null given.

Check failure on line 64 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-lowest, ubuntu-latest)

Call to function in_array() requires parameter #3 to be set.

Check failure on line 64 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-lowest, ubuntu-latest)

Only booleans are allowed in a negated boolean, League\OAuth2\Server\Entities\ClaimSetEntryInterface|null given.

Check failure on line 64 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-lowest, ubuntu-latest)

Call to function in_array() requires parameter #3 to be set.

Check failure on line 64 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-lowest, ubuntu-latest)

Only booleans are allowed in a negated boolean, League\OAuth2\Server\Entities\ClaimSetEntryInterface|null given.

Check failure on line 64 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-lowest, ubuntu-latest)

Call to function in_array() requires parameter #3 to be set.

Check failure on line 64 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-lowest, ubuntu-latest)

Only booleans are allowed in a negated boolean, League\OAuth2\Server\Entities\ClaimSetEntryInterface|null given.

Check failure on line 64 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-stable, ubuntu-latest)

Call to function in_array() requires parameter #3 to be set.

Check failure on line 64 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-stable, ubuntu-latest)

Only booleans are allowed in a negated boolean, League\OAuth2\Server\Entities\ClaimSetEntryInterface|null given.

Check failure on line 64 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-lowest, ubuntu-latest)

Call to function in_array() requires parameter #3 to be set.

Check failure on line 64 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-lowest, ubuntu-latest)

Only booleans are allowed in a negated boolean, League\OAuth2\Server\Entities\ClaimSetEntryInterface|null given.

Check failure on line 64 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-lowest, ubuntu-latest)

Call to function in_array() requires parameter #3 to be set.

Check failure on line 64 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-lowest, ubuntu-latest)

Only booleans are allowed in a negated boolean, League\OAuth2\Server\Entities\ClaimSetEntryInterface|null given.

Check failure on line 64 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-stable, ubuntu-latest)

Call to function in_array() requires parameter #3 to be set.

Check failure on line 64 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-stable, ubuntu-latest)

Only booleans are allowed in a negated boolean, League\OAuth2\Server\Entities\ClaimSetEntryInterface|null given.

Check failure on line 64 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-stable, ubuntu-latest)

Call to function in_array() requires parameter #3 to be set.

Check failure on line 64 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-stable, ubuntu-latest)

Only booleans are allowed in a negated boolean, League\OAuth2\Server\Entities\ClaimSetEntryInterface|null given.

Check failure on line 64 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-lowest, ubuntu-latest)

Call to function in_array() requires parameter #3 to be set.

Check failure on line 64 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-lowest, ubuntu-latest)

Only booleans are allowed in a negated boolean, League\OAuth2\Server\Entities\ClaimSetEntryInterface|null given.
throw new InvalidArgumentException(
sprintf('%s is a protected scope and is pre-defined by the OpenID Connect specification.', $claimSetEntry->getScope())
);
Expand Down Expand Up @@ -103,7 +102,7 @@
$keys = array_keys($claims);

foreach ($scopes as $scope) {
$scopeName = ($scope instanceof ScopeEntityInterface) ? $scope->getIdentifier() : $scope;

Check failure on line 105 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-stable, ubuntu-latest)

Else branch is unreachable because ternary operator condition is always true.

Check failure on line 105 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-stable, ubuntu-latest)

Instanceof between League\OAuth2\Server\Entities\ScopeEntityInterface and League\OAuth2\Server\Entities\ScopeEntityInterface will always evaluate to true.

Check failure on line 105 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-lowest, ubuntu-latest)

Else branch is unreachable because ternary operator condition is always true.

Check failure on line 105 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-lowest, ubuntu-latest)

Instanceof between League\OAuth2\Server\Entities\ScopeEntityInterface and League\OAuth2\Server\Entities\ScopeEntityInterface will always evaluate to true.

Check failure on line 105 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-lowest, ubuntu-latest)

Else branch is unreachable because ternary operator condition is always true.

Check failure on line 105 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-lowest, ubuntu-latest)

Instanceof between League\OAuth2\Server\Entities\ScopeEntityInterface and League\OAuth2\Server\Entities\ScopeEntityInterface will always evaluate to true.

Check failure on line 105 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-lowest, ubuntu-latest)

Else branch is unreachable because ternary operator condition is always true.

Check failure on line 105 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-lowest, ubuntu-latest)

Instanceof between League\OAuth2\Server\Entities\ScopeEntityInterface and League\OAuth2\Server\Entities\ScopeEntityInterface will always evaluate to true.

Check failure on line 105 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-stable, ubuntu-latest)

Else branch is unreachable because ternary operator condition is always true.

Check failure on line 105 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-stable, ubuntu-latest)

Instanceof between League\OAuth2\Server\Entities\ScopeEntityInterface and League\OAuth2\Server\Entities\ScopeEntityInterface will always evaluate to true.

Check failure on line 105 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-lowest, ubuntu-latest)

Else branch is unreachable because ternary operator condition is always true.

Check failure on line 105 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-lowest, ubuntu-latest)

Instanceof between League\OAuth2\Server\Entities\ScopeEntityInterface and League\OAuth2\Server\Entities\ScopeEntityInterface will always evaluate to true.

Check failure on line 105 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-lowest, ubuntu-latest)

Else branch is unreachable because ternary operator condition is always true.

Check failure on line 105 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-lowest, ubuntu-latest)

Instanceof between League\OAuth2\Server\Entities\ScopeEntityInterface and League\OAuth2\Server\Entities\ScopeEntityInterface will always evaluate to true.

Check failure on line 105 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-stable, ubuntu-latest)

Else branch is unreachable because ternary operator condition is always true.

Check failure on line 105 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-stable, ubuntu-latest)

Instanceof between League\OAuth2\Server\Entities\ScopeEntityInterface and League\OAuth2\Server\Entities\ScopeEntityInterface will always evaluate to true.

Check failure on line 105 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-stable, ubuntu-latest)

Else branch is unreachable because ternary operator condition is always true.

Check failure on line 105 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-stable, ubuntu-latest)

Instanceof between League\OAuth2\Server\Entities\ScopeEntityInterface and League\OAuth2\Server\Entities\ScopeEntityInterface will always evaluate to true.

Check failure on line 105 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-lowest, ubuntu-latest)

Else branch is unreachable because ternary operator condition is always true.

Check failure on line 105 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-lowest, ubuntu-latest)

Instanceof between League\OAuth2\Server\Entities\ScopeEntityInterface and League\OAuth2\Server\Entities\ScopeEntityInterface will always evaluate to true.

$claimSet = $this->getClaimSet($scopeName);
if (null === $claimSet) {
Expand All @@ -112,14 +111,14 @@

$intersected = array_intersect($claimSet->getClaims(), $keys);

if (empty($intersected)) {

Check failure on line 114 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-stable, ubuntu-latest)

Construct empty() is not allowed. Use more strict comparison.

Check failure on line 114 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-lowest, ubuntu-latest)

Construct empty() is not allowed. Use more strict comparison.

Check failure on line 114 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-lowest, ubuntu-latest)

Construct empty() is not allowed. Use more strict comparison.

Check failure on line 114 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-lowest, ubuntu-latest)

Construct empty() is not allowed. Use more strict comparison.

Check failure on line 114 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-stable, ubuntu-latest)

Construct empty() is not allowed. Use more strict comparison.

Check failure on line 114 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-lowest, ubuntu-latest)

Construct empty() is not allowed. Use more strict comparison.

Check failure on line 114 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-lowest, ubuntu-latest)

Construct empty() is not allowed. Use more strict comparison.

Check failure on line 114 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-stable, ubuntu-latest)

Construct empty() is not allowed. Use more strict comparison.

Check failure on line 114 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-stable, ubuntu-latest)

Construct empty() is not allowed. Use more strict comparison.

Check failure on line 114 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-lowest, ubuntu-latest)

Construct empty() is not allowed. Use more strict comparison.
continue;
}

$data = array_filter(
$claims,
function ($key) use ($intersected) {
return in_array($key, $intersected);

Check failure on line 121 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-stable, ubuntu-latest)

Call to function in_array() requires parameter #3 to be set.

Check failure on line 121 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-lowest, ubuntu-latest)

Call to function in_array() requires parameter #3 to be set.

Check failure on line 121 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-lowest, ubuntu-latest)

Call to function in_array() requires parameter #3 to be set.

Check failure on line 121 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-lowest, ubuntu-latest)

Call to function in_array() requires parameter #3 to be set.

Check failure on line 121 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-stable, ubuntu-latest)

Call to function in_array() requires parameter #3 to be set.

Check failure on line 121 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-lowest, ubuntu-latest)

Call to function in_array() requires parameter #3 to be set.

Check failure on line 121 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-lowest, ubuntu-latest)

Call to function in_array() requires parameter #3 to be set.

Check failure on line 121 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-stable, ubuntu-latest)

Call to function in_array() requires parameter #3 to be set.

Check failure on line 121 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-stable, ubuntu-latest)

Call to function in_array() requires parameter #3 to be set.

Check failure on line 121 in src/ClaimExtractor.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-lowest, ubuntu-latest)

Call to function in_array() requires parameter #3 to be set.
},
ARRAY_FILTER_USE_KEY
);
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 @@

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

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

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

Expand All @@ -55,7 +52,7 @@
EventEmitter $emitter,
?ClaimExtractorInterface $extractor = null
) {
if (!$extractor) {

Check failure on line 55 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-stable, ubuntu-latest)

Only booleans are allowed in a negated boolean, League\OAuth2\Server\ClaimExtractorInterface|null given.

Check failure on line 55 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-lowest, ubuntu-latest)

Only booleans are allowed in a negated boolean, League\OAuth2\Server\ClaimExtractorInterface|null given.

Check failure on line 55 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-lowest, ubuntu-latest)

Only booleans are allowed in a negated boolean, League\OAuth2\Server\ClaimExtractorInterface|null given.

Check failure on line 55 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-lowest, ubuntu-latest)

Only booleans are allowed in a negated boolean, League\OAuth2\Server\ClaimExtractorInterface|null given.

Check failure on line 55 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-stable, ubuntu-latest)

Only booleans are allowed in a negated boolean, League\OAuth2\Server\ClaimExtractorInterface|null given.

Check failure on line 55 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-lowest, ubuntu-latest)

Only booleans are allowed in a negated boolean, League\OAuth2\Server\ClaimExtractorInterface|null given.

Check failure on line 55 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-lowest, ubuntu-latest)

Only booleans are allowed in a negated boolean, League\OAuth2\Server\ClaimExtractorInterface|null given.

Check failure on line 55 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-stable, ubuntu-latest)

Only booleans are allowed in a negated boolean, League\OAuth2\Server\ClaimExtractorInterface|null given.

Check failure on line 55 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-stable, ubuntu-latest)

Only booleans are allowed in a negated boolean, League\OAuth2\Server\ClaimExtractorInterface|null given.

Check failure on line 55 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-lowest, ubuntu-latest)

Only booleans are allowed in a negated boolean, League\OAuth2\Server\ClaimExtractorInterface|null given.
$this->extractor = new ClaimExtractor();
} else {
$this->extractor = $extractor;
Expand Down Expand Up @@ -83,9 +80,9 @@

$builder = $this->idTokenRepository->getBuilder($accessToken);

if ($claimSet instanceof ClaimSetEntryInterface) {

Check failure on line 83 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-stable, ubuntu-latest)

Instanceof between League\OAuth2\Server\Entities\ClaimSetEntryInterface and League\OAuth2\Server\Entities\ClaimSetEntryInterface will always evaluate to true.

Check failure on line 83 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-lowest, ubuntu-latest)

Instanceof between League\OAuth2\Server\Entities\ClaimSetEntryInterface and League\OAuth2\Server\Entities\ClaimSetEntryInterface will always evaluate to true.

Check failure on line 83 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-lowest, ubuntu-latest)

Instanceof between League\OAuth2\Server\Entities\ClaimSetEntryInterface and League\OAuth2\Server\Entities\ClaimSetEntryInterface will always evaluate to true.

Check failure on line 83 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-lowest, ubuntu-latest)

Instanceof between League\OAuth2\Server\Entities\ClaimSetEntryInterface and League\OAuth2\Server\Entities\ClaimSetEntryInterface will always evaluate to true.

Check failure on line 83 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-stable, ubuntu-latest)

Instanceof between League\OAuth2\Server\Entities\ClaimSetEntryInterface and League\OAuth2\Server\Entities\ClaimSetEntryInterface will always evaluate to true.

Check failure on line 83 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-lowest, ubuntu-latest)

Instanceof between League\OAuth2\Server\Entities\ClaimSetEntryInterface and League\OAuth2\Server\Entities\ClaimSetEntryInterface will always evaluate to true.

Check failure on line 83 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-lowest, ubuntu-latest)

Instanceof between League\OAuth2\Server\Entities\ClaimSetEntryInterface and League\OAuth2\Server\Entities\ClaimSetEntryInterface will always evaluate to true.

Check failure on line 83 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-stable, ubuntu-latest)

Instanceof between League\OAuth2\Server\Entities\ClaimSetEntryInterface and League\OAuth2\Server\Entities\ClaimSetEntryInterface will always evaluate to true.

Check failure on line 83 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-stable, ubuntu-latest)

Instanceof between League\OAuth2\Server\Entities\ClaimSetEntryInterface and League\OAuth2\Server\Entities\ClaimSetEntryInterface will always evaluate to true.

Check failure on line 83 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-lowest, ubuntu-latest)

Instanceof between League\OAuth2\Server\Entities\ClaimSetEntryInterface and League\OAuth2\Server\Entities\ClaimSetEntryInterface will always evaluate to true.
foreach ($this->extractor->extract($accessToken->getScopes(), $claimSet->getClaims()) as $claimName => $claimValue) {
$builder = $builder->withClaim($claimName, $claimValue);

Check failure on line 85 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-stable, ubuntu-latest)

Parameter #1 $name of method Lcobucci\JWT\Builder::withClaim() expects non-empty-string, string given.

Check failure on line 85 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-lowest, ubuntu-latest)

Parameter #1 $name of method Lcobucci\JWT\Builder::withClaim() expects non-empty-string, string given.

Check failure on line 85 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-lowest, ubuntu-latest)

Parameter #1 $name of method Lcobucci\JWT\Builder::withClaim() expects non-empty-string, string given.

Check failure on line 85 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-lowest, ubuntu-latest)

Parameter #1 $name of method Lcobucci\JWT\Builder::withClaim() expects non-empty-string, string given.

Check failure on line 85 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-stable, ubuntu-latest)

Parameter #1 $name of method Lcobucci\JWT\Builder::withClaim() expects non-empty-string, string given.

Check failure on line 85 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-lowest, ubuntu-latest)

Parameter #1 $name of method Lcobucci\JWT\Builder::withClaim() expects non-empty-string, string given.

Check failure on line 85 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-lowest, ubuntu-latest)

Parameter #1 $name of method Lcobucci\JWT\Builder::withClaim() expects non-empty-string, string given.

Check failure on line 85 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-stable, ubuntu-latest)

Parameter #1 $name of method Lcobucci\JWT\Builder::withClaim() expects non-empty-string, string given.

Check failure on line 85 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-stable, ubuntu-latest)

Parameter #1 $name of method Lcobucci\JWT\Builder::withClaim() expects non-empty-string, string given.

Check failure on line 85 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-lowest, ubuntu-latest)

Parameter #1 $name of method Lcobucci\JWT\Builder::withClaim() expects non-empty-string, string given.
}
}

Expand All @@ -95,7 +92,7 @@

$token = $builder->getToken(
new Sha256(),
InMemory::file($this->privateKey->getKeyPath(), (string) $this->privateKey->getPassPhrase())

Check failure on line 95 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-stable, ubuntu-latest)

Parameter #1 $path of static method Lcobucci\JWT\Signer\Key\InMemory::file() expects non-empty-string, string given.

Check failure on line 95 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-lowest, ubuntu-latest)

Parameter #1 $path of static method Lcobucci\JWT\Signer\Key\InMemory::file() expects non-empty-string, string given.

Check failure on line 95 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-lowest, ubuntu-latest)

Parameter #1 $path of static method Lcobucci\JWT\Signer\Key\InMemory::file() expects non-empty-string, string given.

Check failure on line 95 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-lowest, ubuntu-latest)

Parameter #1 $path of static method Lcobucci\JWT\Signer\Key\InMemory::file() expects non-empty-string, string given.

Check failure on line 95 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-stable, ubuntu-latest)

Parameter #1 $path of static method Lcobucci\JWT\Signer\Key\InMemory::file() expects non-empty-string, string given.

Check failure on line 95 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-lowest, ubuntu-latest)

Parameter #1 $path of static method Lcobucci\JWT\Signer\Key\InMemory::file() expects non-empty-string, string given.

Check failure on line 95 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-lowest, ubuntu-latest)

Parameter #1 $path of static method Lcobucci\JWT\Signer\Key\InMemory::file() expects non-empty-string, string given.

Check failure on line 95 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-stable, ubuntu-latest)

Parameter #1 $path of static method Lcobucci\JWT\Signer\Key\InMemory::file() expects non-empty-string, string given.

Check failure on line 95 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.1, prefer-stable, ubuntu-latest)

Parameter #1 $path of static method Lcobucci\JWT\Signer\Key\InMemory::file() expects non-empty-string, string given.

Check failure on line 95 in src/ResponseTypes/IdTokenResponse.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-lowest, ubuntu-latest)

Parameter #1 $path of static method Lcobucci\JWT\Signer\Key\InMemory::file() expects non-empty-string, string given.
);

$this->getEmitter()->emit(
Expand All @@ -111,7 +108,6 @@
* 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')));
}
}
Loading