We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
array
decode
1 parent 8becb3b commit 4db1e95Copy full SHA for 4db1e95
src/JWT.php
@@ -66,16 +66,13 @@ class JWT
66
* @uses jsonDecode
67
* @uses urlsafeB64Decode
68
*/
69
- public static function decode($jwt, $key, $allowed_algs = array())
+ public static function decode($jwt, $key, array $allowed_algs = array())
70
{
71
$timestamp = is_null(static::$timestamp) ? time() : static::$timestamp;
72
73
if (empty($key)) {
74
throw new InvalidArgumentException('Key may not be empty');
75
}
76
- if (!is_array($allowed_algs)) {
77
- throw new InvalidArgumentException('Algorithm not allowed');
78
- }
79
$tks = explode('.', $jwt);
80
if (count($tks) != 3) {
81
throw new UnexpectedValueException('Wrong number of segments');
0 commit comments