germania-kg / token
简单令牌
1.1.0
2023-01-03 13:25 UTC
Requires
- php: ^7.4|^8.0
- psr/log: ^1.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.12
- php-coveralls/php-coveralls: ^2.0
- phpspec/prophecy-phpunit: ^2.0
- phpstan/phpstan: ^1.9
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2024-08-30 01:21:15 UTC
README
Germania KG · Token
简单令牌
安装
$ composer install germania-kg/token
接口 TokenInterface
interface TokenInterface { // Alias for "getContent" public function __toString(); // Returns the token "text". public function getContent() : string; // Returns the lifetime in seconds. public function getLifeTime() : int; }
类 AuthToken
<?php use Germania\Token\Token; // Pass token string and TTL $auth_token = new Token( "somerandomstring", 3600); echo $auth_token; // "somerandomstring" echo $auth_token->__toString(); // "somerandomstring" echo $auth_token->getContent(); // "somerandomstring" echo $auth_token->getLifeTime(); // 3600
测试
$ composer phpunit