Skip to content

Commit 25bcb76

Browse files
authored
Merge pull request #34 from mhf-ir/patch-1
Add IDE Helper
2 parents 2d569b8 + a08f446 commit 25bcb76

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

README.md

+32
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,38 @@ 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+
347+
function jwt_decode(string $token, string $key, string $algorithm = 'HS256'): array
348+
{
349+
return [];
350+
}
351+
}
352+
353+
namespace Cdoco {
354+
// @codingStandardsIgnoreStart
355+
abstract class JWT
356+
// @codingStandardsIgnoreEnd
357+
{
358+
abstract public static function encode(array $payload, string $key, string $algorithm = 'HS256'): string;
359+
360+
abstract public static function decode(string $token, string $key, string $algorithm = 'HS256'): array;
361+
}
362+
}
363+
```
364+
333365
## The algorithm of support
334366

335367
algorithm|-|-|-

0 commit comments

Comments
 (0)