Files

43 lines
1.3 KiB
PHP
Raw Permalink Normal View History

2026-10-05 18:10:18 -04:00
<?php
declare(strict_types=1);
2026-10-12 01:27:47 -04:00
namespace Pterodactyl\Data;
2026-10-05 18:10:18 -04:00
final readonly class EggImportVariable
{
public function __construct(
public string $name,
public string $description,
public string $environmentVariable,
public string $defaultValue,
public bool $userViewable,
public bool $userEditable,
public string $rules,
) {}
/**
* @return array{name: string, description: string, env_variable: string, default_value: string, user_viewable: bool, user_editable: bool, rules: string}
*/
public function attributes(): array
{
return [
'name' => $this->name,
'description' => $this->description,
'env_variable' => $this->environmentVariable,
'default_value' => $this->defaultValue,
'user_viewable' => $this->userViewable,
'user_editable' => $this->userEditable,
'rules' => $this->rules,
];
}
/**
* @return array{name: string, description: string, env_variable: string, default_value: string, user_viewable: bool, user_editable: bool, rules: string, egg_id: int}
*/
public function attributesForEgg(int $eggId): array
{
return array_merge($this->attributes(), ['egg_id' => $eggId]);
}
}