germania-kg / token
Simple tokens
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-10-30 01:48:12 UTC
README
Germania KG ยท Token
Simple tokens
Installation
$ composer install germania-kg/token
Interface 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; }
Class 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
Testing
$ composer phpunit