diff --git a/src/Symfony/Component/Routing/Router.php b/src/Symfony/Component/Routing/Router.php index f617a60b559e..bd2c5a11bd0a 100644 --- a/src/Symfony/Component/Routing/Router.php +++ b/src/Symfony/Component/Routing/Router.php @@ -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))); } }