Skip to content

Commit 3cfef01

Browse files
Update src/Symfony/Component/HttpKernel/EventListener/RouterListener.php
Co-authored-by: Nicolas Grekas <nicolas.grekas@gmail.com>
1 parent b492022 commit 3cfef01

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/Symfony/Component/HttpKernel/EventListener/RouterListener.php

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -117,16 +117,13 @@ public function onKernelRequest(RequestEvent $event): void
117117
$attributes = [];
118118

119119
foreach ($parameters as $parameter => $value) {
120-
if(isset($mapping[$parameter])) {
121-
if(is_array($mapping[$parameter])) {
122-
[$attribute, $parameter] = $mapping[$parameter];
123-
$mappedAttributes[$attribute] = '';
124-
} else {
125-
$attribute = $mapping[$parameter];
126-
}
127-
128-
} else {
120+
if (!isset($mapping[$parameter])) {
129121
$attribute = $parameter;
122+
} elseif (\is_array($mapping[$parameter])) {
123+
[$attribute, $parameter] = $mapping[$parameter];
124+
$mappedAttributes[$attribute] = '';
125+
} else {
126+
$attribute = $mapping[$parameter];
130127
}
131128

132129
if (!isset($mappedAttributes[$attribute])) {

0 commit comments

Comments
 (0)