Files
pterodactyl-panel/app/Data/EggImportVariable.php
T
2026-10-12 05:18:58 -04:00

43 lines
1.3 KiB
PHP

<?php
declare(strict_types=1);
namespace Pterodactyl\Data;
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]);
}
}