Skip to content

Commit dd30ef2

Browse files
committed
allow psr 7 v2 and update dependencies
1 parent 4bbdbe9 commit dd30ef2

File tree

10 files changed

+57
-79
lines changed

10 files changed

+57
-79
lines changed

Diff for: .github/workflows/continuous-integration.yml

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ jobs:
5858
- "7.4"
5959
- "8.0"
6060
- "8.1"
61+
- "8.2"
6162
deps:
6263
- "--prefer-lowest"
6364
- ""

Diff for: composer.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@
3030
"require": {
3131
"php": "^7.4 || ^8.0",
3232
"ext-json": "*",
33-
"facile-it/php-jose-verifier": "^0.3 || ^0.4",
33+
"facile-it/php-jose-verifier": "^0.3 || ^0.4.3",
3434
"php-http/discovery": "^1.6",
3535
"psr/http-client": "^1.0",
3636
"psr/http-client-implementation": "^1.0",
3737
"psr/http-factory": "^1.0",
3838
"psr/http-factory-implementation": "^1.0",
39-
"psr/http-message": "^1.0",
39+
"psr/http-message": "^1.0 || ^2.0",
4040
"psr/http-message-implementation": "^1.0",
4141
"psr/http-server-middleware": "^1.0",
4242
"web-token/jwt-checker": "^2.0 || ^3.0",
@@ -74,7 +74,7 @@
7474
"laminas/laminas-component-installer": "^2.1 || ^3.0",
7575
"laminas/laminas-config-aggregator": "^1.1",
7676
"laminas/laminas-di": "^3.1",
77-
"laminas/laminas-diactoros": "^2.1",
77+
"laminas/laminas-diactoros": "^2.1 || ^3.0",
7878
"laminas/laminas-servicemanager": "^3.4",
7979
"php-http/cache-plugin": "^1.6",
8080
"php-http/curl-client": "^2.0",
@@ -90,6 +90,8 @@
9090
"web-token/jwt-encryption-algorithm-aeskw": "^2.0 || ^3.0",
9191
"web-token/jwt-encryption-algorithm-dir": "^2.0 || ^3.0",
9292
"web-token/jwt-encryption-algorithm-ecdh-es": "^2.0 || ^3.0",
93+
"web-token/jwt-signature-algorithm-eddsa": "^2.2.0 || ^3.0",
94+
"web-token/jwt-encryption-algorithm-ecdh-es": "^2.2.0 || ^3.0",
9395
"web-token/jwt-encryption-algorithm-experimental": "^2.0 || ^3.0",
9496
"web-token/jwt-encryption-algorithm-pbes2": "^2.0 || ^3.0",
9597
"web-token/jwt-encryption-algorithm-rsa": "^2.0 || ^3.0",

Diff for: composer.lock

+29-41
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: psalm-baseline.xml

-28
This file was deleted.

Diff for: psalm.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
66
xmlns="https://getpsalm.org/schema/config"
77
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
8-
findUnusedBaselineEntry="false"
8+
findUnusedBaselineEntry="true"
99
findUnusedCode="false"
10-
errorBaseline="psalm-baseline.xml"
1110
>
1211
<projectFiles>
1312
<directory name="src" />

Diff for: src/Claims/AbstractClaims.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,14 @@ protected function assignClaims(array $claims, array $sourceNames, array $source
158158
throw new RuntimeException(sprintf('Unable to find claim "%s" in source "%s"', $claim, $inSource));
159159
}
160160

161-
/** @var scalar $value */
161+
/** @psalm-var scalar $value */
162162
$value = $sources[$inSource][$claim];
163163
$claims[$claim] = $value;
164-
/** @var TokenSetClaimsType $claims */
164+
/** @psalm-var TokenSetClaimsType $claims */
165165
$claims['_claim_names'] = array_diff_key($claims['_claim_names'] ?? [], array_flip([$claim]));
166166
}
167167

168+
/** @psalm-var TokenSetClaimsType $claims */
168169
return $claims;
169170
}
170171

Diff for: src/Issuer/Metadata/Provider/CachedProviderDecorator.php

+7
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ public function __construct(
4848
$this->cacheIdGenerator = $cacheIdGenerator ?? static fn (string $uri): string => substr(sha1($uri), 0, 65);
4949
}
5050

51+
/**
52+
* @return array<string, mixed>
53+
*
54+
* @psalm-return IssuerMetadataObject
55+
*
56+
* @psalm-suppress MixedReturnTypeCoercion
57+
*/
5158
public function fetch(string $uri): array
5259
{
5360
$cacheId = ($this->cacheIdGenerator)($uri);

Diff for: src/Issuer/Metadata/Provider/DiscoveryProvider.php

+8-1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ public function isAllowedUri(string $uri): bool
4848
return (int) preg_match('/https?:\/\//', $uri) > 0;
4949
}
5050

51+
/**
52+
* @return array<string, mixed>
53+
*
54+
* @psalm-return IssuerMetadataObject
55+
*
56+
* @psalm-suppress MixedReturnTypeCoercion
57+
*/
5158
public function discovery(string $url): array
5259
{
5360
$uri = $this->uriFactory->createUri($url);
@@ -85,7 +92,7 @@ private function fetchOpenIdConfiguration(string $uri): array
8592
->withHeader('accept', 'application/json');
8693

8794
try {
88-
/** @var IssuerMetadataObject $data */
95+
/** @psalm-var IssuerMetadataObject $data */
8996
$data = parse_metadata_response($this->client->sendRequest($request));
9097
} catch (ClientExceptionInterface $e) {
9198
throw new RuntimeException('Unable to fetch provider metadata', 0, $e);

Diff for: src/Token/TokenSetInterface.php

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
* @psalm-type TokenSetAttributesType = array{}&array{
4444
* code?: string,
4545
* access_token?: string,
46+
* id_token?: string,
4647
* token_type?: string,
4748
* refresh_token?: string,
4849
* expires_in?: int,

Diff for: stubs/Jose/Component/Signature/JWSBuilder.php.stub

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ class JWSBuilder
3939
/**
4040
* Adds the information needed to compute the signature. This method will return a new JWSBuilder object.
4141
*
42-
* @param array{}&array{alg?: string} $protectedHeader
43-
* @param array{}&array{alg?: string} $header
42+
* @psalm-param array{alg?: string, ...} $protectedHeader
43+
* @psalm-param array{alg?: string, ...} $header
4444
*/
4545
public function addSignature(JWK $signatureKey, array $protectedHeader, array $header = []): self
4646
{

0 commit comments

Comments
 (0)