[Routing] small refactoring in Router

This commit is contained in:
Tobias Schultze 2012-08-29 09:36:18 +03:00
parent 9f4525a614
commit dd0403f117
1 changed files with 1 additions and 3 deletions

View File

@ -83,17 +83,15 @@ class Router implements RouterInterface
// 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)));
}
}