mirror of
https://github.com/opdavies/versa.git
synced 2025-03-20 12:05:24 +00:00
Add a Symfony project type
This commit is contained in:
parent
4c9abd8599
commit
de5b3af017
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
|
* Add a Symfony project type.
|
||||||
* Automatically use PHPUnit or ParaTest based on `require-dev` dependencies.
|
* 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.
|
* 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.
|
* Add `versa build` to build a Sculpin project.
|
||||||
|
|
|
@ -9,4 +9,5 @@ enum ProjectType: string
|
||||||
// PHP.
|
// PHP.
|
||||||
case Drupal = 'drupal';
|
case Drupal = 'drupal';
|
||||||
case Sculpin = 'sculpin';
|
case Sculpin = 'sculpin';
|
||||||
|
case Symfony = 'symfony';
|
||||||
}
|
}
|
||||||
|
|
5
versa
5
versa
|
@ -68,6 +68,8 @@ $application->setCode(function (InputInterface $input): int {
|
||||||
$projectType = ProjectType::Drupal->value;
|
$projectType = ProjectType::Drupal->value;
|
||||||
} elseif (in_array(needle: 'sculpin/sculpin', haystack: $dependencies, strict: true)) {
|
} elseif (in_array(needle: 'sculpin/sculpin', haystack: $dependencies, strict: true)) {
|
||||||
$projectType = ProjectType::Sculpin->value;
|
$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;
|
break;
|
||||||
|
|
||||||
|
case ProjectType::Symfony->value:
|
||||||
|
throw new RuntimeException('No build command set for Symfony projects.');
|
||||||
|
|
||||||
case ProjectType::Sculpin->value:
|
case ProjectType::Sculpin->value:
|
||||||
$process = Process::create(
|
$process = Process::create(
|
||||||
command: ['./vendor/bin/sculpin', 'generate'],
|
command: ['./vendor/bin/sculpin', 'generate'],
|
||||||
|
|
Loading…
Reference in a new issue