Skip to content

Commit 3a51eda

Browse files
committed
Added some error handling in case an invalid yaml file exists
1 parent 838cbc2 commit 3a51eda

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

ScriptHandler.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ public static function buildParameters(Event $event)
5151
// find the actual params
5252
$actualValues = array('parameters' => array());
5353
if ($exists) {
54-
$actualValues = array_merge($actualValues, $yamlParser->parse(file_get_contents($realFile)));
54+
$existingValues = $yamlParser->parse(file_get_contents($realFile));
55+
if (!is_array($existingValues)) {
56+
throw new \InvalidArgumentException(sprintf('The existing "%s" file does not contain an array', $realFile));
57+
}
58+
$actualValues = array_merge($actualValues, $existingValues);
5559
}
5660
$actualParams = (array) $actualValues['parameters'];
5761

0 commit comments

Comments
 (0)