mirror of
https://gh.wpcy.net/https://github.com/fairpm/aspirecloud.git
synced 2026-06-20 02:22:28 +08:00
36 lines
942 B
PHP
36 lines
942 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Values\WpOrg\Themes;
|
|
|
|
use App\Models\WpOrg\Theme;
|
|
use App\Values\DTO;
|
|
use Bag\Attributes\Transforms;
|
|
|
|
readonly class ThemeUpdateData extends DTO
|
|
{
|
|
public function __construct(
|
|
public string $name,
|
|
public string $theme,
|
|
public string $new_version,
|
|
public string $url,
|
|
public string $package,
|
|
public ?string $requires,
|
|
public ?string $requires_php,
|
|
) {}
|
|
|
|
/** @return array<string, mixed> */
|
|
#[Transforms(Theme::class)]
|
|
public static function fromTheme(Theme $theme): array
|
|
{
|
|
return [
|
|
'name' => $theme->name,
|
|
'theme' => $theme->slug,
|
|
'new_version' => $theme->version,
|
|
'url' => $theme->download_link,
|
|
'package' => $theme->download_link,
|
|
'requires' => $theme->requires,
|
|
'requires_php' => $theme->requires_php,
|
|
];
|
|
}
|
|
}
|