You've already forked wc-licensed-product-client
Add object-oriented license client library (v0.0.2)
- Add LicenseClient with PSR-3 logging and PSR-6 caching support - Add DTO classes: LicenseInfo, LicenseStatus, ActivationResult - Add LicenseState enum for license status values - Add comprehensive exception hierarchy for error handling - Add PSR dependencies (psr/log, psr/cache, psr/http-client) - Update README with usage examples - Update CHANGELOG for v0.0.2 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
22
src/Dto/ActivationResult.php
Normal file
22
src/Dto/ActivationResult.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Magdev\WcLicensedProductClient\Dto;
|
||||
|
||||
final readonly class ActivationResult
|
||||
{
|
||||
public function __construct(
|
||||
public bool $success,
|
||||
public string $message,
|
||||
) {
|
||||
}
|
||||
|
||||
public static function fromArray(array $data): self
|
||||
{
|
||||
return new self(
|
||||
success: $data['success'],
|
||||
message: $data['message'],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user