From dccb4a83fa60dfe069ecae1b5b7916bab2022e7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82?= Date: Thu, 21 Jul 2016 11:02:57 +0200 Subject: [PATCH] added `array` type hinting to `decode` method --- src/JWT.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/JWT.php b/src/JWT.php index 6d30e941..d4852a6d 100644 --- a/src/JWT.php +++ b/src/JWT.php @@ -64,16 +64,13 @@ class JWT * @uses jsonDecode * @uses urlsafeB64Decode */ - public static function decode($jwt, $key, $allowed_algs = array()) + public static function decode($jwt, $key, array $allowed_algs = array()) { $timestamp = is_null(static::$timestamp) ? time() : static::$timestamp; if (empty($key)) { throw new InvalidArgumentException('Key may not be empty'); } - if (!is_array($allowed_algs)) { - throw new InvalidArgumentException('Algorithm not allowed'); - } $tks = explode('.', $jwt); if (count($tks) != 3) { throw new UnexpectedValueException('Wrong number of segments');