Skip to content

Commit 6d4cb1a

Browse files
vierbergenlarslsmith77
authored andcommitted
Fix bug in RestYamlCollectionLoader that does not forward defaults and requirements.
1 parent 4290af3 commit 6d4cb1a

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

Routing/Loader/RestYamlCollectionLoader.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,15 @@ public function load($file, $type = null)
6868
// process routes and imports
6969
foreach ($config as $name => $config) {
7070
if (isset($config['resource'])) {
71-
$resource = $config['resource'];
72-
$prefix = isset($config['prefix']) ? $config['prefix'] : null;
73-
$namePrefix = isset($config['name_prefix']) ? $config['name_prefix'] : null;
74-
$parent = isset($config['parent']) ? $config['parent'] : null;
75-
$type = isset($config['type']) ? $config['type'] : null;
76-
$options = isset($config['options']) ? $config['options'] : null;
77-
$currentDir = dirname($path);
71+
$resource = $config['resource'];
72+
$prefix = isset($config['prefix']) ? $config['prefix'] : null;
73+
$namePrefix = isset($config['name_prefix']) ? $config['name_prefix'] : null;
74+
$parent = isset($config['parent']) ? $config['parent'] : null;
75+
$type = isset($config['type']) ? $config['type'] : null;
76+
$requirements = isset($config['requirements']) ? $config['requirements'] : array();
77+
$defaults = isset($config['defaults']) ? $config['defaults'] : array();
78+
$options = isset($config['options']) ? $config['options'] : array();
79+
$currentDir = dirname($path);
7880

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

97-
if ($options) {
98-
$imported->addOptions($options);
99-
}
99+
$imported->addRequirements($requirements);
100+
$imported->addDefaults($defaults);
101+
$imported->addOptions($options);
100102

101103
$imported->addPrefix($prefix);
102104
$collection->addCollection($imported);

0 commit comments

Comments
 (0)