removed irrelevant string case in XmlFileLoader
getAttribute() always returns a string
This commit is contained in:
parent
9ffe3de642
commit
94ec653818
@ -73,10 +73,10 @@ class XmlFileLoader extends FileLoader
|
||||
$this->parseRoute($collection, $node, $path);
|
||||
break;
|
||||
case 'import':
|
||||
$resource = (string) $node->getAttribute('resource');
|
||||
$type = (string) $node->getAttribute('type');
|
||||
$prefix = (string) $node->getAttribute('prefix');
|
||||
$hostnamePattern = (string) $node->getAttribute('hostname-pattern');
|
||||
$resource = $node->getAttribute('resource');
|
||||
$type = $node->getAttribute('type');
|
||||
$prefix = $node->getAttribute('prefix');
|
||||
$hostnamePattern = $node->getAttribute('hostname-pattern');
|
||||
|
||||
$defaults = array();
|
||||
$requirements = array();
|
||||
@ -89,13 +89,13 @@ class XmlFileLoader extends FileLoader
|
||||
|
||||
switch ($n->tagName) {
|
||||
case 'default':
|
||||
$defaults[(string) $n->getAttribute('key')] = trim((string) $n->nodeValue);
|
||||
$defaults[$n->getAttribute('key')] = trim($n->nodeValue);
|
||||
break;
|
||||
case 'requirement':
|
||||
$requirements[(string) $n->getAttribute('key')] = trim((string) $n->nodeValue);
|
||||
$requirements[$n->getAttribute('key')] = trim($n->nodeValue);
|
||||
break;
|
||||
case 'option':
|
||||
$options[(string) $n->getAttribute('key')] = trim((string) $n->nodeValue);
|
||||
$options[$n->getAttribute('key')] = trim($n->nodeValue);
|
||||
break;
|
||||
default:
|
||||
throw new \InvalidArgumentException(sprintf('Unable to parse tag "%s"', $n->tagName));
|
||||
@ -142,22 +142,22 @@ class XmlFileLoader extends FileLoader
|
||||
|
||||
switch ($node->tagName) {
|
||||
case 'default':
|
||||
$defaults[(string) $node->getAttribute('key')] = trim((string) $node->nodeValue);
|
||||
$defaults[$node->getAttribute('key')] = trim((string) $node->nodeValue);
|
||||
break;
|
||||
case 'option':
|
||||
$options[(string) $node->getAttribute('key')] = trim((string) $node->nodeValue);
|
||||
$options[$node->getAttribute('key')] = trim((string) $node->nodeValue);
|
||||
break;
|
||||
case 'requirement':
|
||||
$requirements[(string) $node->getAttribute('key')] = trim((string) $node->nodeValue);
|
||||
$requirements[$node->getAttribute('key')] = trim((string) $node->nodeValue);
|
||||
break;
|
||||
default:
|
||||
throw new \InvalidArgumentException(sprintf('Unable to parse tag "%s"', $node->tagName));
|
||||
}
|
||||
}
|
||||
|
||||
$route = new Route((string) $definition->getAttribute('pattern'), $defaults, $requirements, $options, (string) $definition->getAttribute('hostname-pattern'));
|
||||
$route = new Route($definition->getAttribute('pattern'), $defaults, $requirements, $options, $definition->getAttribute('hostname-pattern'));
|
||||
|
||||
$collection->add((string) $definition->getAttribute('id'), $route);
|
||||
$collection->add($definition->getAttribute('id'), $route);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user