8000 Merge branch '4.0' · symfony/symfony@add5d84 · GitHub
[go: up one dir, main page]

Skip to content

Commit add5d84

Browse files
Merge branch '4.0'
* 4.0: fix merge
2 parents f06fa04 + 05782ad commit add5d84

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -641,14 +641,17 @@ private function compileRoute(Route $route, string $name, bool $checkHost): stri
641641
$code .= sprintf(" \$ret = array('_route' => '%s');\n", $name);
642642
}
643643

644+
if ($methods) {
645+
$methodVariable = isset($methods['GET']) ? '$canonicalMethod' : '$requestMethod';
646+
$methods = self::export($methods);
647+
}
648+
644649
if ($schemes = $route->getSchemes()) {
645650
if (!$this->supportsRedirections) {
646651
throw new \LogicException('The "schemes" requirement is only supported for URL matchers that implement RedirectableUrlMatcherInterface.');
647652
}
648653
$schemes = self::export(array_flip($schemes));
649654
if ($methods) {
650-
$methodVariable = isset($methods['GET']) ? '$canonicalMethod' : '$requestMethod';
651-
$methods = self::export($methods);
652655
$code .= <<<EOF
653656
\$requiredSchemes = $schemes;
654657
\$hasRequiredScheme = isset(\$requiredSchemes[\$context->getScheme()]);
@@ -683,9 +686,6 @@ private function compileRoute(Route $route, string $name, bool $checkHost): stri
683686
EOF;
684687
}
685688
} elseif ($methods) {
686-
$methodVariable = isset($methods['GET']) ? '$canonicalMethod' : '$requestMethod';
687-
$methods = self::export($methods);
688-
689689
$code .= <<<EOF
690690
if (!isset((\$a = {$methods})[{$methodVariable}])) {
691691
\$allow += \$a;

0 commit comments

Comments
 (0)
0