Skip to content
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
4 changes: 2 additions & 2 deletions src/Bundle/Routing/JWKSetLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ public function add(string $pattern, string $name): void
$this->routes->add(sprintf('jwkset_%s', $name), $route);
}

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

public function supports(mixed $resource, string $type = null): bool
public function supports(mixed $resource, ?string $type = null): bool
{
return $type === 'jwkset';
}
Expand Down
4 changes: 2 additions & 2 deletions src/Bundle/Serializer/JWESerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ public function getSupportedTypes(?string $format): array
];
}

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

public function denormalize(mixed $data, string $type, string $format = null, array $context = []): JWE
public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): JWE
{
if ($data instanceof JWE === false) {
throw new LogicException('Expected data to be a JWE.');
Expand Down
4 changes: 2 additions & 2 deletions src/Bundle/Serializer/JWSSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ public function getSupportedTypes(?string $format): array
];
}

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

public function denormalize(mixed $data, string $type, string $format = null, array $context = []): JWS
public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): JWS
{
if ($data instanceof JWS === false) {
throw new LogicException('Expected data to be a JWS.');
Expand Down
2 changes: 1 addition & 1 deletion src/Bundle/Services/JWEDecrypter.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function decryptUsingKeySet(
JWE &$jwe,
JWKSet $jwkset,
int $recipient,
JWK &$jwk = null,
?JWK &$jwk = null,
?JWK $senderKey = null
): bool {
$success = parent::decryptUsingKeySet($jwe, $jwkset, $recipient, $jwk, $senderKey);
Expand Down
2 changes: 1 addition & 1 deletion src/Bundle/Services/JWSVerifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function verifyWithKeySet(
JWKSet $jwkset,
int $signatureIndex,
?string $detachedPayload = null,
JWK &$jwk = null
?JWK &$jwk = null
): bool {
$success = parent::verifyWithKeySet($jws, $jwkset, $signatureIndex, $detachedPayload, $jwk);
if ($success) {
Expand Down
2 changes: 1 addition & 1 deletion src/Library/Console/KeyAnalyzerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ final class KeyAnalyzerCommand extends Command

public function __construct(
private readonly KeyAnalyzerManager $analyzerManager,
string $name = null
?string $name = null
) {
parent::__construct($name);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Library/Console/KeysetAnalyzerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ final class KeysetAnalyzerCommand extends Command
public function __construct(
private readonly KeysetAnalyzerManager $keysetAnalyzerManager,
private readonly KeyAnalyzerManager $keyAnalyzerManager,
string $name = null
?string $name = null
) {
parent::__construct($name);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Library/Encryption/JWEDecrypter.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function decryptUsingKeySet(
JWE &$jwe,
JWKSet $jwkset,
int $recipient,
JWK &$jwk = null,
?JWK &$jwk = null,
?JWK $senderKey = null
): bool {
if ($jwkset->count() === 0) {
Expand All @@ -142,7 +142,7 @@ private function decryptRecipientKey(
JWE $jwe,
JWKSet $jwkset,
int $i,
JWK &$successJwk = null,
?JWK &$successJwk = null,
?JWK $senderKey = null
): ?string {
$recipient = $jwe->getRecipient($i);
Expand Down
4 changes: 2 additions & 2 deletions src/Library/Signature/JWSVerifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function verifyWithKeySet(
JWKSet $jwkset,
int $signatureIndex,
?string $detachedPayload = null,
JWK &$jwk = null
?JWK &$jwk = null
): bool {
if ($jwkset->count() === 0) {
throw new InvalidArgumentException('There is no key in the key set.');
Expand All @@ -78,7 +78,7 @@ private function verifySignature(
JWKSet $jwkset,
Signature $signature,
?string $detachedPayload = null,
JWK &$successJwk = null
?JWK &$successJwk = null
): bool {
$input = $this->getInputToVerify($jws, $signature, $detachedPayload);
$algorithm = $this->getAlgorithm($signature);
Expand Down