浏览代码

Merge remote branch 'beberlei/YamlRoutingLoader'

* beberlei/YamlRoutingLoader:
  [Routing] Remove exception condition in YamlFileLoader::load() as its duplicating a check that is done in parseRoute() anyways. This changes allows to extend the YamlFileLoader without having to duplicate the whole method.
Fabien Potencier 14 年之前
父节点
当前提交
ac1bde9003
共有 1 个文件被更改,包括 1 次插入3 次删除
  1. 1 3
      src/Symfony/Component/Routing/Loader/YamlFileLoader.php

+ 1 - 3
src/Symfony/Component/Routing/Loader/YamlFileLoader.php

@@ -65,10 +65,8 @@ class YamlFileLoader extends FileLoader
                 $prefix = isset($config['prefix']) ? $config['prefix'] : null;
                 $this->setCurrentDir(dirname($path));
                 $collection->addCollection($this->import($config['resource'], $type, false, $file), $prefix);
-            } elseif (isset($config['pattern'])) {
-                $this->parseRoute($collection, $name, $config, $path);
             } else {
-                throw new \InvalidArgumentException(sprintf('Unable to parse the "%s" route.', $name));
+                $this->parseRoute($collection, $name, $config, $path);
             }
         }