Merge remote branch 'Chekote/xmlfileloader_overload_refactor'

* Chekote/xmlfileloader_overload_refactor:
  Refactored the processing of each individual node into it's own method, enabling easier overloading of behavior for Bundles such as FriendsOfSymfony/RestBundle
This commit is contained in:
Fabien Potencier 2011-05-26 18:25:53 +02:00
commit 1c0dfad979

View File

@ -48,6 +48,21 @@ class XmlFileLoader extends FileLoader
continue;
}
$this->parseNode($collection, $node, $path);
}
return $collection;
}
/**
* Parses a node from a loaded XML file.
*
* @param RouteCollection $collection the collection to associate with the node
* @param DOMElement $node the node to parse
* @param string $path the path of the XML file being processed
*/
protected function parseNode(RouteCollection $collection, \DOMElement $node, $path)
{
switch ($node->tagName) {
case 'route':
$this->parseRoute($collection, $node, $path);
@ -64,9 +79,6 @@ class XmlFileLoader extends FileLoader
}
}
return $collection;
}
/**
* Returns true if this class supports the given resource.
*