From 2b9795d736aec18cc998ecfd0e12c6c8b27a1c61 Mon Sep 17 00:00:00 2001 From: Andrii Vasyliev Date: Tue, 17 Oct 2017 15:57:32 +0000 Subject: [PATCH] fixed expects array error --- src/Builder.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Builder.php b/src/Builder.php index 26241a6..86e99bf 100644 --- a/src/Builder.php +++ b/src/Builder.php @@ -172,10 +172,12 @@ public function buildConfig($name, array $configs, $defines = []) protected function pushEnvVars($vars) { $env = $this->vars['dotenv']; - foreach (array_keys($vars) as $key) { - $envKey = strtoupper(strtr($key, '.', '_')); - if (isset($env[$envKey])) { - $vars[$key] = $env[$envKey]; + if (!empty($vars)) { + foreach (array_keys($vars) as $key) { + $envKey = strtoupper(strtr($key, '.', '_')); + if (isset($env[$envKey])) { + $vars[$key] = $env[$envKey]; + } } }