@@ -44,18 +44,15 @@ public function __construct(
4444
4545 public function fetch (OpenIDClient $ client , array $ claims , array $ accessTokens = []): array
4646 {
47- $ claimSources = $ claims ['_claim_sources ' ] ?? null ;
48- $ claimNames = $ claims ['_claim_names ' ] ?? null ;
49-
50- if (! is_array ($ claimSources )) {
47+ if (! array_key_exists ('_claim_sources ' , $ claims )) {
5148 return $ claims ;
5249 }
5350
54- if (! is_array ( $ claimNames )) {
51+ if (! array_key_exists ( ' _claim_names ' , $ claims )) {
5552 return $ claims ;
5653 }
5754
58- $ distributedSources = array_filter ($ claimSources , fn ($ value ): bool => $ this ->isDistributedSource ($ value ));
55+ $ distributedSources = array_filter ($ claims [ ' _claim_sources ' ] , fn ($ value ): bool => $ this ->isDistributedSource ($ value ));
5956
6057 /** @var array<string, ResponseInterface> $responses */
6158 $ responses = [];
@@ -80,13 +77,12 @@ public function fetch(OpenIDClient $client, array $claims, array $accessTokens =
8077 try {
8178 check_server_response ($ response );
8279 $ claimPayloads [$ sourceName ] = $ this ->claimJWT ($ client , (string ) $ response ->getBody ());
83- /** @psalm-suppress PossiblyNullArrayAccess */
8480 unset($ claims ['_claim_sources ' ][$ sourceName ]);
8581 } catch (Throwable $ e ) {
8682 throw new RuntimeException ("Unable to fetch distributed claim for \"{$ sourceName }\"" , 0 , $ e );
8783 }
8884 }
8985
90- return $ this ->cleanClaims ($ this ->assignClaims ($ claims , $ claimNames , $ claimPayloads ));
86+ return $ this ->cleanClaims ($ this ->assignClaims ($ claims , $ claims [ ' _claim_names ' ] , $ claimPayloads ));
9187 }
9288}
0 commit comments