Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

removed irrelevant string case in XmlFileLoader

getAttribute() always returns a string
  • Loading branch information...
commit 94ec65381826faf6761731e507ca27591197864a 1 parent 9ffe3de
@Tobion Tobion authored arnaud-lb committed
Showing with 12 additions and 12 deletions.
  1. +12 −12 src/Symfony/Component/Routing/Loader/XmlFileLoader.php
View
24 src/Symfony/Component/Routing/Loader/XmlFileLoader.php
@@ -73,10 +73,10 @@ protected function parseNode(RouteCollection $collection, \DOMElement $node, $pa
$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 @@ protected function parseNode(RouteCollection $collection, \DOMElement $node, $pa
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 @@ protected function parseRoute(RouteCollection $collection, \DOMElement $definiti
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);
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.