mirror of
https://github.com/opdavies/build-configs.git
synced 2025-03-13 05:26:56 +00:00
27 lines
805 B
PHP
27 lines
805 B
PHP
|
<?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);
|
||
|
}
|
||
|
}
|