From de5b3af0173d156d94010c53e4302a3b438ed50d Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 21 Feb 2024 00:41:49 +0000 Subject: [PATCH] Add a Symfony project type --- CHANGELOG.md | 1 + src/Enum/ProjectType.php | 1 + versa | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9f5391..3ec3bcd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/src/Enum/ProjectType.php b/src/Enum/ProjectType.php index 8ce09eb..c036761 100644 --- a/src/Enum/ProjectType.php +++ b/src/Enum/ProjectType.php @@ -9,4 +9,5 @@ enum ProjectType: string // PHP. case Drupal = 'drupal'; case Sculpin = 'sculpin'; + case Symfony = 'symfony'; } diff --git a/versa b/versa index 59f9f56..a764bb3 100755 --- a/versa +++ b/versa @@ -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'],