diff options
author | MichaĆ <kmike090@gmail.com> | 2017-06-26 18:56:41 +0200 |
---|---|---|
committer | Brent Shaffer <betterbrent@google.com> | 2017-06-26 09:56:41 -0700 |
commit | 4db1e95de5e6fd56af1a6f3ea4cdc6ccd65393d0 (patch) | |
tree | 845dd1d9961e4b54e57472ac90f6c887c9e17367 /src | |
parent | 8becb3b775a2288bda7259f6d13fce89999a4a14 (diff) | |
download | php-jwt-4db1e95de5e6fd56af1a6f3ea4cdc6ccd65393d0.zip php-jwt-4db1e95de5e6fd56af1a6f3ea4cdc6ccd65393d0.tar.gz php-jwt-4db1e95de5e6fd56af1a6f3ea4cdc6ccd65393d0.tar.bz2 |
added `array` type hinting to `decode` method (#101)
Diffstat (limited to 'src')
-rw-r--r-- | src/JWT.php | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/JWT.php b/src/JWT.php index cb1ca7d..22a67e3 100644 --- a/src/JWT.php +++ b/src/JWT.php @@ -66,16 +66,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'); |