2023-04-07 20:00:25 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace OliverDaviesLtd\BuildConfigs;
|
|
|
|
|
|
|
|
use Symfony\Component\Validator\Constraints as Assert;
|
|
|
|
|
|
|
|
final class ConfigurationData
|
|
|
|
{
|
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,
|
|
|
|
fields: ['useNewDatabaseCredentials' => new Assert\Type('boolean')]
|
|
|
|
)]
|
|
|
|
public array $experimental;
|
|
|
|
|
2023-04-07 20:00:25 +01:00
|
|
|
#[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;
|
|
|
|
}
|