give
/
vendor
/
vendor-prefixed
/
stellarwp
/
licensing-api-client
/
src
/
Requests
/
Token
/
Create.php
give
/
vendor
/
vendor-prefixed
/
stellarwp
/
licensing-api-client
/
src
/
Requests
/
Token
Last commit date
Create.php
3 months ago
Revoke.php
3 months ago
Create.php
34 lines
| 1 | <?php declare(strict_types=1); |
| 2 | |
| 3 | namespace Give\Vendors\LiquidWeb\LicensingApiClient\Requests\Token; |
| 4 | |
| 5 | /** |
| 6 | * Represents a token creation request payload. |
| 7 | * |
| 8 | * @phpstan-type CreateTokenPayload array{ |
| 9 | * license_key: string, |
| 10 | * domain: string |
| 11 | * } |
| 12 | */ |
| 13 | final class Create |
| 14 | { |
| 15 | public string $licenseKey; |
| 16 | |
| 17 | public string $domain; |
| 18 | |
| 19 | public function __construct(string $licenseKey, string $domain) { |
| 20 | $this->licenseKey = $licenseKey; |
| 21 | $this->domain = $domain; |
| 22 | } |
| 23 | |
| 24 | /** |
| 25 | * @return CreateTokenPayload |
| 26 | */ |
| 27 | public function toArray(): array { |
| 28 | return [ |
| 29 | 'license_key' => $this->licenseKey, |
| 30 | 'domain' => $this->domain, |
| 31 | ]; |
| 32 | } |
| 33 | } |
| 34 |