| Total Complexity | 4 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | final class JWTClient |
||
| 9 | { |
||
| 10 | /** @var string */ |
||
| 11 | private string $apiKey; |
||
| 12 | /** @var string */ |
||
| 13 | private string $apiSecret; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Do NOT sign in the constructor. Just store normalized strings. |
||
| 17 | */ |
||
| 18 | public function __construct(string $apiKey, string $apiSecret) |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Build a short-lived JWT token. HMAC key MUST be a string. |
||
| 27 | * Throws InvalidArgumentException when config is missing. |
||
| 28 | */ |
||
| 29 | public function makeToken(): string |
||
| 43 |