From 155f0e1fad3f6df7d68ae4211d84746134806b6f Mon Sep 17 00:00:00 2001 From: jubianchi Date: Fri, 17 Nov 2017 00:15:11 +0100 Subject: [PATCH] fix: Handle conditions in depends_on Closes #22 --- src/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/functions.php b/src/functions.php index 3ac1fa8..ea031a9 100644 --- a/src/functions.php +++ b/src/functions.php @@ -256,10 +256,10 @@ function makeVerticesAndEdges(Graph $graph, array $services, array $volumes, arr ); } - foreach ($definition['depends_on'] ?? [] as $dependency) { + foreach ($definition['depends_on'] ?? [] as $key => $dependency) { addRelation( $graph->getVertex($service), - addService($graph, $dependency), + addService($graph, is_array($dependency) ? $key : $dependency), 'depends_on' ); }