test: ensure the project type is valid

This commit is contained in:
Oliver Davies 2023-11-22 21:43:07 +00:00
parent 08852c898a
commit e9d5c4ea6f
5 changed files with 53 additions and 12 deletions

View file

@ -221,7 +221,7 @@ final class Config
#[Assert\NotBlank]
#[Assert\Type('string')]
#[Assert\Choice(choices: ['drupal', 'fractal', 'laravel', 'php-library', 'symfony'])]
#[Assert\Choice(choices: ['astro', 'drupal', 'fractal', 'laravel', 'php-library', 'symfony', 'terraform'])]
public string $type;
#[Assert\Type('array')]

View file

@ -4,10 +4,13 @@ declare(strict_types=1);
namespace App\Enum;
enum ProjectType
enum ProjectType: string
{
case Astro;
case Drupal;
case Fractal;
case Terraform;
case Astro = 'astro';
case Drupal = 'drupal';
case Fractal = 'fractal';
case Laravel = 'laravel';
case PHPLibrary = 'php-library';
case Symfony = 'symfony';
case Terraform = 'terraform';
}