Completed
Pull Request — master (#131)
by Jesus
03:22
created
lib/firebase/php-jwt/src/JWT.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -174,7 +174,7 @@
 block discarded – undo
174 174
      * Sign a string with a given key and algorithm.
175 175
      *
176 176
      * @param string            $msg    The message to sign
177
-     * @param string|resource   $key    The secret key
177
+     * @param string   $key    The secret key
178 178
      * @param string            $alg    The signing algorithm.
179 179
      *                                  Supported algorithms are 'HS256', 'HS384', 'HS512' and 'RS256'
180 180
      *
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
         if ($keyId !== null) {
157 157
             $header['kid'] = $keyId;
158 158
         }
159
-        if ( isset($head) && is_array($head) ) {
159
+        if (isset($head) && is_array($head)) {
160 160
             $header = array_merge($head, $header);
161 161
         }
162 162
         $segments = array();
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
             throw new DomainException('Algorithm not supported');
189 189
         }
190 190
         list($function, $algorithm) = static::$supported_algs[$alg];
191
-        switch($function) {
191
+        switch ($function) {
192 192
             case 'hash_hmac':
193 193
                 return hash_hmac($algorithm, $msg, $key, true);
194 194
             case 'openssl':
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
         }
223 223
 
224 224
         list($function, $algorithm) = static::$supported_algs[$alg];
225
-        switch($function) {
225
+        switch ($function) {
226 226
             case 'openssl':
227 227
                 $success = openssl_verify($msg, $signature, $key, $algorithm);
228 228
                 if (!$success) {
@@ -270,8 +270,8 @@  discard block
 block discarded – undo
270 270
              * manually detect large ints in the JSON string and quote them (thus converting
271 271
              *them to strings) before decoding, hence the preg_replace() call.
272 272
              */
273
-            $max_int_length = strlen((string) PHP_INT_MAX) - 1;
274
-            $json_without_bigints = preg_replace('/:\s*(-?\d{'.$max_int_length.',})/', ': "$1"', $input);
273
+            $max_int_length = strlen((string)PHP_INT_MAX) - 1;
274
+            $json_without_bigints = preg_replace('/:\s*(-?\d{' . $max_int_length . ',})/', ': "$1"', $input);
275 275
             $obj = json_decode($json_without_bigints);
276 276
         }
277 277
 
Please login to merge, or discard this patch.