@@ -36,9 +36,9 @@ class JWT
36
36
* we want to provide some extra leeway time to
37
37
* account for clock skew.
38
38
*/
39
- public static /* int */ $ leeway = 0 ;
39
+ /* int */ public static $ leeway = 0 ;
40
40
41
- public static /* array */ $ supported_algs = [
41
+ /* array */ public static $ supported_algs = [
42
42
'ES384 ' => ['openssl ' , 'SHA384 ' ],
43
43
'ES256 ' => ['openssl ' , 'SHA256 ' ],
44
44
'HS256 ' => ['hash_hmac ' , 'SHA256 ' ],
@@ -75,7 +75,8 @@ class JWT
75
75
*/
76
76
public static function decode (
77
77
string $ jwt ,
78
- /* Key|array|ArrayAccess */ $ keyOrKeyArray
78
+ /* Key|array|ArrayAccess */
79
+ $ keyOrKeyArray
79
80
): stdClass {
80
81
// Validate JWT
81
82
$ timestamp = \time ();
@@ -163,7 +164,8 @@ public static function decode(
163
164
*/
164
165
public static function encode (
165
166
array $ payload ,
166
- /* string|resource|OpenSSLAsymmetricKey */ $ key ,
167
+ /* string|resource|OpenSSLAsymmetricKey */
168
+ $ key ,
167
169
string $ alg ,
168
170
string $ keyId = null ,
169
171
array $ head = null
@@ -200,7 +202,8 @@ public static function encode(
200
202
*/
201
203
public static function sign (
202
204
string $ msg ,
203
- /* string|resource|OpenSSLAsymmetricKey */ $ key ,
205
+ /* string|resource|OpenSSLAsymmetricKey */
206
+ $ key ,
204
207
string $ alg
205
208
): string {
206
209
if (empty (static ::$ supported_algs [$ alg ])) {
@@ -255,7 +258,8 @@ public static function sign(
255
258
private static function verify (
256
259
string $ msg ,
257
260
string $ signature ,
258
- /* string|resource|OpenSSLAsymmetricKey */ $ keyMaterial ,
261
+ /* string|resource|OpenSSLAsymmetricKey */
262
+ $ keyMaterial ,
259
263
string $ alg
260
264
): bool {
261
265
if (empty (static ::$ supported_algs [$ alg ])) {
@@ -381,7 +385,8 @@ public static function urlsafeB64Encode(string $input): string
381
385
* @return Key
382
386
*/
383
387
private static function getKey (
384
- /* Key|array|ArrayAccess */ $ keyOrKeyArray ,
388
+ /* Key|array|ArrayAccess */
389
+ $ keyOrKeyArray ,
385
390
?string $ kid
386
391
): Key {
387
392
if ($ keyOrKeyArray instanceof Key) {
0 commit comments