fix: extensions could be null

Warning: Undefined array key "extensions" in /home/opdavies/Code/github.com/OliverDaviesLtd/build-configs/src/Action/CreateFinalConfigurationData.php on line 44

Warning: Trying to access array offset on value of type null in /home/opdavies/Code/github.com/OliverDaviesLtd/build-configs/src/Action/CreateFinalConfigurationData.php on line 44
This commit is contained in:
Oliver Davies 2023-08-26 23:08:44 +01:00
parent ec494d934f
commit f16ccb81bb

View file

@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Action;
use Illuminate\Support\Arr;
use Symfony\Component\Yaml\Yaml;
final class CreateFinalConfigurationData
@ -41,7 +42,7 @@ final class CreateFinalConfigurationData
$configurationData['dockerfile']['stages']['build']['packages'] = $basePackages;
$configurationData['dockerfile']['stages']['build']['extensions']['install'] = collect($phpExtensions)
->merge($configurationData['dockerfile']['stages']['build']['extensions']['install'])
->merge(Arr::get($configurationData, 'dockerfile.stages.build.extensions.install'))
->unique()
->sort()
->toArray();