Parses a node from a loaded XML file.
RouteCollection $collection Collection to associate with the node:
\DOMElement $node Element to parse:
string $path Full path of the XML file being processed:
string $file Loaded file name:
\InvalidArgumentException When the XML is invalid
protected function parseNode(RouteCollection $collection, \DOMElement $node, $path, $file) {
if (self::NAMESPACE_URI !== $node->namespaceURI) {
return;
}
switch ($node->localName) {
case 'route':
$this
->parseRoute($collection, $node, $path);
break;
case 'import':
$this
->parseImport($collection, $node, $path, $file);
break;
default:
throw new \InvalidArgumentException(sprintf('Unknown tag "%s" used in file "%s". Expected "route" or "import".', $node->localName, $path));
}
}