Skip to content

Commit ba07e0f

Browse files
Explicitly mark parameter as nullable (#558)
1 parent cdeb1f5 commit ba07e0f

File tree

9 files changed

+14
-14
lines changed

9 files changed

+14
-14
lines changed

src/Bundle/Routing/JWKSetLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ public function add(string $pattern, string $name): void
2929
$this->routes->add(sprintf('jwkset_%s', $name), $route);
3030
}
3131

32-
public function load(mixed $resource, string $type = null): RouteCollection
32+
public function load(mixed $resource, ?string $type = null): RouteCollection
3333
{
3434
return $this->routes;
3535
}
3636

37-
public function supports(mixed $resource, string $type = null): bool
37+
public function supports(mixed $resource, ?string $type = null): bool
3838
{
3939
return $type === 'jwkset';
4040
}

src/Bundle/Serializer/JWESerializer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ public function getSupportedTypes(?string $format): array
3333
];
3434
}
3535

36-
public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool
36+
public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
3737
{
3838
return $type === JWE::class
3939
&& class_exists(JWESerializerManager::class)
4040
&& $this->formatSupported($format);
4141
}
4242

43-
public function denormalize(mixed $data, string $type, string $format = null, array $context = []): JWE
43+
public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): JWE
4444
{
4545
if ($data instanceof JWE === false) {
4646
throw new LogicException('Expected data to be a JWE.');

src/Bundle/Serializer/JWSSerializer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ public function getSupportedTypes(?string $format): array
3333
];
3434
}
3535

36-
public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool
36+
public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
3737
{
3838
return $type === JWS::class
3939
&& class_exists(JWSSerializerManager::class)
4040
&& $this->formatSupported($format);
4141
}
4242

43-
public function denormalize(mixed $data, string $type, string $format = null, array $context = []): JWS
43+
public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): JWS
4444
{
4545
if ($data instanceof JWS === false) {
4646
throw new LogicException('Expected data to be a JWS.');

src/Bundle/Services/JWEDecrypter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function decryptUsingKeySet(
2929
JWE &$jwe,
3030
JWKSet $jwkset,
3131
int $recipient,
32-
JWK &$jwk = null,
32+
?JWK &$jwk = null,
3333
?JWK $senderKey = null
3434
): bool {
3535
$success = parent::decryptUsingKeySet($jwe, $jwkset, $recipient, $jwk, $senderKey);

src/Bundle/Services/JWSVerifier.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function verifyWithKeySet(
2727
JWKSet $jwkset,
2828
int $signatureIndex,
2929
?string $detachedPayload = null,
30-
JWK &$jwk = null
30+
?JWK &$jwk = null
3131
): bool {
3232
$success = parent::verifyWithKeySet($jws, $jwkset, $signatureIndex, $detachedPayload, $jwk);
3333
if ($success) {

src/Library/Console/KeyAnalyzerCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final class KeyAnalyzerCommand extends Command
2626

2727
public function __construct(
2828
private readonly KeyAnalyzerManager $analyzerManager,
29-
string $name = null
29+
?string $name = null
3030
) {
3131
parent::__construct($name);
3232
}

src/Library/Console/KeysetAnalyzerCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ final class KeysetAnalyzerCommand extends Command
2929
public function __construct(
3030
private readonly KeysetAnalyzerManager $keysetAnalyzerManager,
3131
private readonly KeyAnalyzerManager $keyAnalyzerManager,
32-
string $name = null
32+
?string $name = null
3333
) {
3434
parent::__construct($name);
3535
}

src/Library/Encryption/JWEDecrypter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function decryptUsingKeySet(
115115
JWE &$jwe,
116116
JWKSet $jwkset,
117117
int $recipient,
118-
JWK &$jwk = null,
118+
?JWK &$jwk = null,
119119
?JWK $senderKey = null
120120
): bool {
121121
if ($jwkset->count() === 0) {
@@ -142,7 +142,7 @@ private function decryptRecipientKey(
142142
JWE $jwe,
143143
JWKSet $jwkset,
144144
int $i,
145-
JWK &$successJwk = null,
145+
?JWK &$successJwk = null,
146146
?JWK $senderKey = null
147147
): ?string {
148148
$recipient = $jwe->getRecipient($i);

src/Library/Signature/JWSVerifier.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function verifyWithKeySet(
5959
JWKSet $jwkset,
6060
int $signatureIndex,
6161
?string $detachedPayload = null,
62-
JWK &$jwk = null
62+
?JWK &$jwk = null
6363
): bool {
6464
if ($jwkset->count() === 0) {
6565
throw new InvalidArgumentException('There is no key in the key set.');
@@ -78,7 +78,7 @@ private function verifySignature(
7878
JWKSet $jwkset,
7979
Signature $signature,
8080
?string $detachedPayload = null,
81-
JWK &$successJwk = null
81+
?JWK &$successJwk = null
8282
): bool {
8383
$input = $this->getInputToVerify($jws, $signature, $detachedPayload);
8484
$algorithm = $this->getAlgorithm($signature);

0 commit comments

Comments
 (0)