Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Loader/YamlFileLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function load($file, $type = null)
}

try {
$config = $this->yamlParser->parse(file_get_contents($path));
$configParsed = $this->yamlParser->parse(file_get_contents($path));
} catch (ParseException $e) {
throw new \InvalidArgumentException(sprintf('The file "%s" does not contain valid YAML.', $path), 0, $e);
}
Expand All @@ -71,16 +71,16 @@ public function load($file, $type = null)
$collection->addResource(new FileResource($path));

// empty file
if (null === $config) {
if (null === $configParsed) {
return $collection;
}

// not an array
if (!is_array($config)) {
if (!is_array($configParsed)) {
throw new \InvalidArgumentException(sprintf('The file "%s" must contain a YAML array.', $path));
}

foreach ($config as $name => $config) {
foreach ($configParsed as $name => $config) {
$this->validate($config, $name, $path);

if (isset($config['resource'])) {
Expand Down