Skip to content

Commit 69657e9

Browse files
committed
[SecurityBundle] avoid unneeded work
1 parent 037de00 commit 69657e9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

DependencyInjection/SecurityExtension.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -567,17 +567,17 @@ private function createSwitchUserListener($container, $id, $config, $defaultProv
567567

568568
private function createRequestMatcher($container, $path = null, $host = null, $methods = array(), $ip = null, array $attributes = array())
569569
{
570+
if ($methods) {
571+
$methods = array_map('strtoupper', (array) $methods);
572+
}
573+
570574
$serialized = serialize(array($path, $host, $methods, $ip, $attributes));
571575
$id = 'security.request_matcher.'.md5($serialized).sha1($serialized);
572576

573577
if (isset($this->requestMatchers[$id])) {
574578
return $this->requestMatchers[$id];
575579
}
576580

577-
if ($methods) {
578-
$methods = array_map('strtoupper', (array) $methods);
579-
}
580-
581581
// only add arguments that are necessary
582582
$arguments = array($path, $host, $methods, $ip, $attributes);
583583
while (count($arguments) > 0 && !end($arguments)) {

0 commit comments

Comments
 (0)