give
/
vendor
/
vendor-prefixed
/
stellarwp
/
licensing-api-client
/
src
/
Responses
/
License
/
StatusChange.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
StatusChange.php
43 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 license status change response. |
| 9 | * |
| 10 | * @implements Response<array{license_key: string, status: string}> |
| 11 | */ |
| 12 | final class StatusChange implements Response |
| 13 | { |
| 14 | public string $licenseKey; |
| 15 | |
| 16 | public string $status; |
| 17 | |
| 18 | private function __construct(string $licenseKey, string $status) { |
| 19 | $this->licenseKey = $licenseKey; |
| 20 | $this->status = $status; |
| 21 | } |
| 22 | |
| 23 | /** |
| 24 | * @param array{license_key: string, status: string} $attributes |
| 25 | */ |
| 26 | public static function from(array $attributes): self { |
| 27 | return new self( |
| 28 | $attributes['license_key'], |
| 29 | $attributes['status'] |
| 30 | ); |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * @return array{license_key: string, status: string} |
| 35 | */ |
| 36 | public function toArray(): array { |
| 37 | return [ |
| 38 | 'license_key' => $this->licenseKey, |
| 39 | 'status' => $this->status, |
| 40 | ]; |
| 41 | } |
| 42 | } |
| 43 |