Update bootstrap/helpers/parsers.php

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
Andras Bacsai
2025-10-15 22:07:59 +02:00
parent fa8393184f
commit 334559bb0b
+1 -2
View File
@@ -32,10 +32,9 @@ function validateDockerComposeForInjection(string $composeYaml): void
throw new \Exception('Invalid YAML format: '.$e->getMessage()); throw new \Exception('Invalid YAML format: '.$e->getMessage());
} }
if (! isset($parsed['services']) || ! is_array($parsed['services'])) { if (! is_array($parsed) || ! isset($parsed['services']) || ! is_array($parsed['services'])) {
throw new \Exception('Docker Compose file must contain a "services" section'); throw new \Exception('Docker Compose file must contain a "services" section');
} }
// Validate service names // Validate service names
foreach ($parsed['services'] as $serviceName => $serviceConfig) { foreach ($parsed['services'] as $serviceName => $serviceConfig) {
try { try {