Skip to content

Commit

Permalink
merged branch Tobion/patch-7 (PR #5377)
Browse files Browse the repository at this point in the history
Commits
-------

dd0403f [Routing] small refactoring in Router

Discussion
----------

[Routing] small refactoring in Router
  • Loading branch information
fabpot committed Aug 29, 2012
2 parents 24a00b5 + dd0403f commit 0881bde
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Symfony/Component/Routing/Router.php
Expand Up @@ -83,17 +83,15 @@ public function setOptions(array $options)

// check option names and live merge, if errors are encountered Exception will be thrown
$invalid = array();
$isInvalid = false;
foreach ($options as $key => $value) {
if (array_key_exists($key, $this->options)) {
$this->options[$key] = $value;
} else {
$isInvalid = true;
$invalid[] = $key;
}
}

if ($isInvalid) {
if ($invalid) {
throw new \InvalidArgumentException(sprintf('The Router does not support the following options: "%s".', implode('\', \'', $invalid)));
}
}
Expand Down

0 comments on commit 0881bde

Please sign in to comment.