| 1 | <?php |
||
| 9 | class Token |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var array |
||
| 13 | */ |
||
| 14 | private $claims; |
||
| 15 | /** |
||
| 16 | * @var string |
||
| 17 | */ |
||
| 18 | private $tokenString; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Constructor |
||
| 22 | * @param string $tokenString |
||
| 23 | * @param array $claims |
||
| 24 | */ |
||
| 25 | 16 | public function __construct($tokenString, $claims = []) |
|
| 30 | |||
| 31 | /** |
||
| 32 | * Get a specific claim |
||
| 33 | * @param string $claim Name of claim |
||
| 34 | * @return mixed Null on not found |
||
| 35 | */ |
||
| 36 | 6 | public function getClaim($claim) |
|
| 43 | |||
| 44 | /** |
||
| 45 | * Get all claims |
||
| 46 | * |
||
| 47 | * @return array |
||
| 48 | */ |
||
| 49 | 1 | public function getClaims() |
|
| 53 | |||
| 54 | /** |
||
| 55 | * Get token string |
||
| 56 | * @return string String variant of token |
||
| 57 | */ |
||
| 58 | 1 | public function getTokenString() |
|
| 62 | |||
| 63 | /** |
||
| 64 | * Convert object to string |
||
| 65 | * @return string String variant of token |
||
| 66 | */ |
||
| 67 | 9 | public function __toString() |
|
| 71 | } |
||
| 72 |