Skip to content
Closed
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/CachedKeySet.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ public function __construct(
ClientInterface $httpClient,
RequestFactoryInterface $httpFactory,
CacheItemPoolInterface $cache,
int $expiresAfter = null,
?int $expiresAfter = null,
bool $rateLimit = false,
string $defaultAlg = null
?string $defaultAlg = null
) {
$this->jwksUri = $jwksUri;
$this->httpClient = $httpClient;
Expand Down
4 changes: 2 additions & 2 deletions src/JWK.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class JWK
*
* @uses parseKey
*/
public static function parseKeySet(array $jwks, string $defaultAlg = null): array
public static function parseKeySet(array $jwks, ?string $defaultAlg = null): array
{
$keys = [];

Expand Down Expand Up @@ -93,7 +93,7 @@ public static function parseKeySet(array $jwks, string $defaultAlg = null): arra
*
* @uses createPemFromModulusAndExponent
*/
public static function parseKey(array $jwk, string $defaultAlg = null): ?Key
public static function parseKey(array $jwk, ?string $defaultAlg = null): ?Key
{
if (empty($jwk)) {
throw new InvalidArgumentException('JWK must not be empty');
Expand Down
6 changes: 3 additions & 3 deletions src/JWT.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class JWT
public static function decode(
string $jwt,
$keyOrKeyArray,
stdClass &$headers = null
?stdClass &$headers = null
): stdClass {
// Validate JWT
$timestamp = \is_null(static::$timestamp) ? \time() : static::$timestamp;
Expand Down Expand Up @@ -200,8 +200,8 @@ public static function encode(
array $payload,
$key,
string $alg,
string $keyId = null,
array $head = null
?string $keyId = null,
?array $head = null
): string {
$header = ['typ' => 'JWT'];
if (isset($head) && \is_array($head)) {
Expand Down