Add a Symfony project type

This commit is contained in:
Oliver Davies 2024-02-21 00:41:49 +00:00
parent 4c9abd8599
commit de5b3af017
3 changed files with 7 additions and 0 deletions

View file

@ -4,6 +4,7 @@
### Added
* Add a Symfony project type.
* Automatically use PHPUnit or ParaTest based on `require-dev` dependencies.
* Automatically find the PHP project type (i.e. Drupal or Sculpin) based on its `composer.json` dependencies.
* Add `versa build` to build a Sculpin project.

View file

@ -9,4 +9,5 @@ enum ProjectType: string
// PHP.
case Drupal = 'drupal';
case Sculpin = 'sculpin';
case Symfony = 'symfony';
}

5
versa
View file

@ -68,6 +68,8 @@ $application->setCode(function (InputInterface $input): int {
$projectType = ProjectType::Drupal->value;
} elseif (in_array(needle: 'sculpin/sculpin', haystack: $dependencies, strict: true)) {
$projectType = ProjectType::Sculpin->value;
} elseif (in_array(needle: 'symfony/framework-bundle', haystack: $dependencies, strict: true)) {
$projectType = ProjectType::Symfony->value;
}
}
@ -92,6 +94,9 @@ $application->setCode(function (InputInterface $input): int {
}
break;
case ProjectType::Symfony->value:
throw new RuntimeException('No build command set for Symfony projects.');
case ProjectType::Sculpin->value:
$process = Process::create(
command: ['./vendor/bin/sculpin', 'generate'],