Skip to content

Commit

Permalink
Fix bug in RestYamlCollectionLoader that does not forward defaults an…
Browse files Browse the repository at this point in the history
…d requirements.
  • Loading branch information
vierbergenlars authored and lsmith77 committed Feb 9, 2015
1 parent 4290af3 commit 6d4cb1a
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions Routing/Loader/RestYamlCollectionLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,15 @@ public function load($file, $type = null)
// process routes and imports
foreach ($config as $name => $config) {
if (isset($config['resource'])) {
$resource = $config['resource'];
$prefix = isset($config['prefix']) ? $config['prefix'] : null;
$namePrefix = isset($config['name_prefix']) ? $config['name_prefix'] : null;
$parent = isset($config['parent']) ? $config['parent'] : null;
$type = isset($config['type']) ? $config['type'] : null;
$options = isset($config['options']) ? $config['options'] : null;
$currentDir = dirname($path);
$resource = $config['resource'];
$prefix = isset($config['prefix']) ? $config['prefix'] : null;
$namePrefix = isset($config['name_prefix']) ? $config['name_prefix'] : null;
$parent = isset($config['parent']) ? $config['parent'] : null;
$type = isset($config['type']) ? $config['type'] : null;
$requirements = isset($config['requirements']) ? $config['requirements'] : array();
$defaults = isset($config['defaults']) ? $config['defaults'] : array();
$options = isset($config['options']) ? $config['options'] : array();
$currentDir = dirname($path);

$parents = array();
if (!empty($parent)) {
Expand All @@ -94,9 +96,9 @@ public function load($file, $type = null)
$this->collectionParents[$name] = $parents;
}

if ($options) {
$imported->addOptions($options);
}
$imported->addRequirements($requirements);
$imported->addDefaults($defaults);
$imported->addOptions($options);

$imported->addPrefix($prefix);
$collection->addCollection($imported);
Expand Down

0 comments on commit 6d4cb1a

Please sign in to comment.