mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-04 15:32:35 +00:00
Plugins base (#613)
* wip * wip * cleanup * notification channels * phpstan * services * remove server types * refactoring * refactoring
This commit is contained in:
34
app/DTOs/DynamicForm.php
Normal file
34
app/DTOs/DynamicForm.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\DTOs;
|
||||
|
||||
readonly class DynamicForm
|
||||
{
|
||||
/**
|
||||
* @param array<int, DynamicField> $fields
|
||||
*/
|
||||
public function __construct(
|
||||
private array $fields = [],
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @param array<int, DynamicField> $fields
|
||||
*/
|
||||
public static function make(array $fields): self
|
||||
{
|
||||
return new self($fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<int, mixed>
|
||||
*/
|
||||
public function toArray(): array
|
||||
{
|
||||
$fields = [];
|
||||
foreach ($this->fields as $field) {
|
||||
$fields[] = $field->toArray();
|
||||
}
|
||||
|
||||
return $fields;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user