We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5460b58 commit a3e0d14Copy full SHA for a3e0d14
README.md
@@ -318,10 +318,10 @@ try {
318
## Functions
319
320
```php
321
-//encode
322
-string jwt_encode(array $claims, string $key [, string $algorithm = 'HS256'])
+// encode
+string jwt_encode(array $payload, string $key [, string $algorithm = 'HS256'])
323
324
-//decode
+// decode
325
array jwt_decode(string $token, string $key [, array $options = ['algorithm' => 'HS256']])
326
```
327
jwt.c
@@ -50,6 +50,18 @@ PHP_JWT_API zend_class_entry *jwt_invalid_sub_cex;
50
51
ZEND_DECLARE_MODULE_GLOBALS(jwt)
52
53
+ZEND_BEGIN_ARG_INFO_EX(arginfo_jwt_encode, 0, 0, 2)
54
+ ZEND_ARG_ARRAY_INFO(0, payload, 1)
55
+ ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 1)
56
+ ZEND_ARG_TYPE_INFO(0, alg, IS_STRING, 1)
57
+ZEND_END_ARG_INFO()
58
+
59
+ZEND_BEGIN_ARG_INFO_EX(arginfo_jwt_decode, 0, 0, 2)
60
+ ZEND_ARG_TYPE_INFO(0, token, IS_STRING, 1)
61
62
+ ZEND_ARG_INFO(0, options)
63
64
65
/* string to algorithm */
66
jwt_alg_t jwt_str_alg(const char *alg)
67
{
@@ -618,8 +630,8 @@ PHP_FUNCTION(jwt_decode)
618
630
}
619
631
620
632
const zend_function_entry jwt_functions[] = {
621
- PHP_FE(jwt_encode, NULL)
622
- PHP_FE(jwt_decode, NULL)
633
+ PHP_FE(jwt_encode, arginfo_jwt_encode)
634
+ PHP_FE(jwt_decode, arginfo_jwt_decode)
623
635
PHP_FE_END
624
636
};
625
637
0 commit comments