8000 [Routing] small refactoring in Router · symfony/symfony@dd0403f · GitHub
[go: up one dir, main page]

Skip to content

Commit dd0403f

Browse files
committed
[Routing] small refactoring in Router
1 parent 9f4525a commit dd0403f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/Symfony/Component/Routing/Router.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,15 @@ public function setOptions(array $options)
8383

8484
// check option names and live merge, if errors are encountered Exception will be thrown
8585
$invalid = array();
86-
$isInvalid = false;
8786
foreach ($options as $key => $value) {
8887
if (array_key_exists($key, $this->options)) {
8988
$this->options[$key] = $value;
9089
} else {
91-
$isInvalid = true;
9290
$invalid[] = $key;
9391
}
9492
}
9593

96-
if ($isInvalid) {
94+
if ($invalid) {
9795
throw new \InvalidArgumentException(sprintf('The Router does not support the following options: "%s".', implode('\', \'', $invalid)));
9896
}
9997
}

0 commit comments

Comments
 (0)
0