mirror of
https://github.com/opdavies/build-configs.git
synced 2025-09-06 11:25:33 +01:00
refactor: use Illuminate Pipelines
This commit is contained in:
parent
830c37c681
commit
d19fcbdede
7 changed files with 343 additions and 211 deletions
26
src/Action/CreateFinalConfigurationData.php
Normal file
26
src/Action/CreateFinalConfigurationData.php
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Action;
|
||||
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
final class CreateFinalConfigurationData
|
||||
{
|
||||
public function handle(string $configFile, \Closure $next) {
|
||||
$configurationData = array_merge(
|
||||
Yaml::parseFile(filename: __DIR__ . '/../../resources/build.defaults.yaml'),
|
||||
Yaml::parseFile(filename: $configFile),
|
||||
);
|
||||
|
||||
if (isset($configurationData['docker-compose'])) {
|
||||
$configurationData['dockerCompose'] = $configurationData['docker-compose'];
|
||||
$configurationData['docker-compose'] = null;
|
||||
}
|
||||
|
||||
$configurationData['managedText'] = 'Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs.';
|
||||
|
||||
return $next($configurationData);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue