2023-04-07 20:00:25 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2023-04-24 00:24:08 +01:00
|
|
|
namespace App\DataTransferObject;
|
2023-04-07 20:00:25 +01:00
|
|
|
|
|
|
|
use Symfony\Component\Validator\Constraints as Assert;
|
|
|
|
|
2023-04-24 00:24:08 +01:00
|
|
|
final class Config
|
2023-04-07 20:00:25 +01:00
|
|
|
{
|
2023-04-16 20:06:52 +01:00
|
|
|
/**
|
|
|
|
* @var array<string,string|integer|array<int,string>>
|
|
|
|
*/
|
2023-04-07 20:00:25 +01:00
|
|
|
#[Assert\Collection(
|
|
|
|
allowExtraFields: false,
|
|
|
|
fields: [
|
|
|
|
'extra_databases' => new Assert\Optional(
|
|
|
|
new Assert\All(new Assert\Type('string'))
|
|
|
|
),
|
|
|
|
'type' => new Assert\Choice(['mariadb', 'mysql']),
|
|
|
|
'version' => new Assert\Type('integer'),
|
|
|
|
],
|
|
|
|
)]
|
|
|
|
public array $database;
|
|
|
|
|
2023-04-16 20:06:52 +01:00
|
|
|
/**
|
|
|
|
* @var array<string,string|null>
|
|
|
|
*/
|
2023-04-07 20:39:34 +01:00
|
|
|
#[Assert\Collection(
|
|
|
|
allowExtraFields: false,
|
2023-04-07 20:55:23 +01:00
|
|
|
fields: ['docroot' => new Assert\Choice([null, 'web', 'docroot'])],
|
2023-04-07 20:39:34 +01:00
|
|
|
)]
|
|
|
|
public array $drupal;
|
|
|
|
|
2023-04-16 20:22:45 +01:00
|
|
|
/**
|
|
|
|
* @var array<string,string|null>
|
|
|
|
*/
|
|
|
|
#[Assert\Collection(
|
|
|
|
allowExtraFields: false,
|
2023-04-21 01:39:03 +01:00
|
|
|
allowMissingFields: true,
|
|
|
|
fields: [
|
|
|
|
'createGitHubActionsConfiguration' => new Assert\Type('boolean'),
|
2023-04-24 22:54:34 +01:00
|
|
|
'runGitHooksBeforePush' => new Assert\Type('boolean'),
|
2023-04-21 01:39:03 +01:00
|
|
|
'useNewDatabaseCredentials' => new Assert\Type('boolean'),
|
|
|
|
]
|
2023-04-16 20:22:45 +01:00
|
|
|
)]
|
|
|
|
public array $experimental;
|
|
|
|
|
2023-09-25 00:17:41 +01:00
|
|
|
#[Assert\Choice(choices: ['javascript', 'php', 'typescript'])]
|
2023-04-07 20:00:25 +01:00
|
|
|
public string $language;
|
|
|
|
|
|
|
|
#[Assert\NotBlank]
|
|
|
|
public string $name;
|
|
|
|
|
2023-09-27 18:57:04 +01:00
|
|
|
#[Assert\Choice(choices: ['astro', 'drupal', 'fractal', 'laravel', 'php-library', 'terraform', 'vuejs'])]
|
2023-04-07 20:00:25 +01:00
|
|
|
#[Assert\NotBlank]
|
|
|
|
public string $type;
|
|
|
|
|
2023-10-18 20:54:36 +02:00
|
|
|
#[Assert\Collection(
|
|
|
|
allowExtraFields: false,
|
|
|
|
fields: [
|
|
|
|
'ignore' => new Assert\Optional([
|
|
|
|
new Assert\Type('array'),
|
|
|
|
new Assert\Count(['min' => 1]),
|
|
|
|
new Assert\All([
|
|
|
|
new Assert\Type('string'),
|
|
|
|
])
|
|
|
|
])
|
|
|
|
]
|
|
|
|
)]
|
|
|
|
public array $git;
|
|
|
|
|
2023-10-18 20:38:53 +02:00
|
|
|
public array $php;
|
2023-04-07 20:00:25 +01:00
|
|
|
}
|