mirror of
https://github.com/opdavies/build-configs.git
synced 2025-09-06 03:15:34 +01:00
refactor(*): change to a Symfony Console app
This commit is contained in:
parent
4af661bad4
commit
8db64458b1
41 changed files with 5938 additions and 4285 deletions
62
src/DataTransferObject/Config.php
Normal file
62
src/DataTransferObject/Config.php
Normal file
|
@ -0,0 +1,62 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\DataTransferObject;
|
||||
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
final class Config
|
||||
{
|
||||
/**
|
||||
* @var array<string,string|integer|array<int,string>>
|
||||
*/
|
||||
#[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;
|
||||
|
||||
/**
|
||||
* @var array<string,string|null>
|
||||
*/
|
||||
#[Assert\Collection(
|
||||
allowExtraFields: false,
|
||||
fields: ['docroot' => new Assert\Choice([null, 'web', 'docroot'])],
|
||||
)]
|
||||
public array $drupal;
|
||||
|
||||
/**
|
||||
* @var array<string,string|null>
|
||||
*/
|
||||
#[Assert\Collection(
|
||||
allowExtraFields: false,
|
||||
allowMissingFields: true,
|
||||
fields: [
|
||||
'createGitHubActionsConfiguration' => new Assert\Type('boolean'),
|
||||
'useNewDatabaseCredentials' => new Assert\Type('boolean'),
|
||||
]
|
||||
)]
|
||||
public array $experimental;
|
||||
|
||||
#[Assert\Choice(choices: ['node', 'php'])]
|
||||
#[Assert\NotBlank]
|
||||
public string $language;
|
||||
|
||||
#[Assert\Length(min: 1)]
|
||||
#[Assert\NotBlank]
|
||||
public string $name;
|
||||
|
||||
#[Assert\Choice(choices: ['drupal-project', 'fractal', 'laravel', 'php-library'])]
|
||||
#[Assert\NotBlank]
|
||||
public string $type;
|
||||
|
||||
#[Assert\NotBlank]
|
||||
public ?string $projectRoot;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue