Skip to content

Commit

Permalink
fix array syntax for PHP 5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer committed Nov 3, 2021
1 parent 28eb0e3 commit 65920fd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/JWT.php
Original file line number Diff line number Diff line change
Expand Up @@ -394,11 +394,11 @@ public static function urlsafeB64Encode($input)
private static function getKeyMaterialAndAlgorithm($keyOrKeyArray, $kid = null)
{
if (is_string($keyOrKeyArray)) {
return [$keyOrKeyArray, null];
return array($keyOrKeyArray, null);
}

if ($keyOrKeyArray instanceof Key) {
return [$keyOrKeyArray->getKeyMaterial(), $keyOrKeyArray->getAlgorithm()];
return array($keyOrKeyArray->getKeyMaterial(), $keyOrKeyArray->getAlgorithm());
}

if (is_array($keyOrKeyArray) || $keyOrKeyArray instanceof ArrayAccess) {
Expand All @@ -412,10 +412,10 @@ private static function getKeyMaterialAndAlgorithm($keyOrKeyArray, $kid = null)
$key = $keyOrKeyArray[$kid];

if ($key instanceof Key) {
return [$key->getKeyMaterial(), $key->getAlgorithm()];
return array($key->getKeyMaterial(), $key->getAlgorithm());
}

return [$key, null];
return array($key, null);
}

throw new UnexpectedValueException(
Expand Down

0 comments on commit 65920fd

Please sign in to comment.