give
/
vendor
/
vendor-prefixed
/
stellarwp
/
licensing-api-client
/
src
/
Responses
/
License
/
RegenerateKey.php
give
/
vendor
/
vendor-prefixed
/
stellarwp
/
licensing-api-client
/
src
/
Responses
/
License
Last commit date
Alias
3 months ago
Listing
3 months ago
ValueObjects
3 months ago
Activate.php
3 months ago
Deactivate.php
3 months ago
DeleteActivation.php
3 months ago
RegenerateKey.php
3 months ago
StatusChange.php
3 months ago
Validate.php
3 months ago
ValidatedProductCollection.php
3 months ago
RegenerateKey.php
36 lines
| 1 | <?php declare(strict_types=1); |
| 2 | |
| 3 | namespace Give\Vendors\LiquidWeb\LicensingApiClient\Responses\License; |
| 4 | |
| 5 | use Give\Vendors\LiquidWeb\LicensingApiClient\Responses\Contracts\Response; |
| 6 | |
| 7 | /** |
| 8 | * Represents a regenerate key response. |
| 9 | * |
| 10 | * @implements Response<array{license_key: string}> |
| 11 | */ |
| 12 | final class RegenerateKey implements Response |
| 13 | { |
| 14 | public string $licenseKey; |
| 15 | |
| 16 | private function __construct(string $licenseKey) { |
| 17 | $this->licenseKey = $licenseKey; |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * @param array{license_key: string} $attributes |
| 22 | */ |
| 23 | public static function from(array $attributes): self { |
| 24 | return new self($attributes['license_key']); |
| 25 | } |
| 26 | |
| 27 | /** |
| 28 | * @return array{license_key: string} |
| 29 | */ |
| 30 | public function toArray(): array { |
| 31 | return [ |
| 32 | 'license_key' => $this->licenseKey, |
| 33 | ]; |
| 34 | } |
| 35 | } |
| 36 |