Skip to content

Commit 4db1e95

Browse files
hywakbshaffer
authored andcommitted
added array type hinting to decode method (#101)
1 parent 8becb3b commit 4db1e95

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Diff for: src/JWT.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,13 @@ class JWT
6666
* @uses jsonDecode
6767
* @uses urlsafeB64Decode
6868
*/
69-
public static function decode($jwt, $key, $allowed_algs = array())
69+
public static function decode($jwt, $key, array $allowed_algs = array())
7070
{
7171
$timestamp = is_null(static::$timestamp) ? time() : static::$timestamp;
7272

7373
if (empty($key)) {
7474
throw new InvalidArgumentException('Key may not be empty');
7575
}
76-
if (!is_array($allowed_algs)) {
77-
throw new InvalidArgumentException('Algorithm not allowed');
78-
}
7976
$tks = explode('.', $jwt);
8077
if (count($tks) != 3) {
8178
throw new UnexpectedValueException('Wrong number of segments');

0 commit comments

Comments
 (0)