Skip to content

Commit d0632d2

Browse files
authored
Add IDE Helper
1 parent 2d569b8 commit d0632d2

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,36 @@ string jwt_encode(array $payload, string $key [, string $algorithm = 'HS256'])
330330
array jwt_decode(string $token, string $key [, array $options = ['algorithm' => 'HS256']])
331331
```
332332

333+
## IDE Helper
334+
335+
```php
336+
<?php
337+
/**
338+
* Put this file into root of your project for IDE helper
339+
* Note: This file don't need to be require/include
340+
*/
341+
namespace {
342+
function jwt_encode(array $payload, string $key, string $algorithm = 'HS256'): string
343+
{
344+
return '';
345+
}
346+
function jwt_decode(string $token, string $key, string $algorithm = 'HS256'): array
347+
{
348+
return [];
349+
}
350+
}
351+
352+
namespace Cdoco {
353+
// @codingStandardsIgnoreStart
354+
abstract class JWT
355+
// @codingStandardsIgnoreEnd
356+
{
357+
abstract public static function encode(array $payload, string $key, string $algorithm = 'HS256'): string;
358+
abstract public static function decode(string $token, string $key, string $algorithm = 'HS256'): array;
359+
}
360+
}
361+
```
362+
333363
## The algorithm of support
334364

335365
algorithm|-|-|-

0 commit comments

Comments
 (0)