[SecurityBundle] avoid unneeded work
This commit is contained in:
parent
87e0e220f6
commit
8135727102
|
@ -567,6 +567,10 @@ class SecurityExtension extends Extension
|
|||
|
||||
private function createRequestMatcher($container, $path = null, $host = null, $methods = array(), $ip = null, array $attributes = array())
|
||||
{
|
||||
if ($methods) {
|
||||
$methods = array_map('strtoupper', (array) $methods);
|
||||
}
|
||||
|
||||
$serialized = serialize(array($path, $host, $methods, $ip, $attributes));
|
||||
$id = 'security.request_matcher.'.md5($serialized).sha1($serialized);
|
||||
|
||||
|
@ -574,10 +578,6 @@ class SecurityExtension extends Extension
|
|||
return $this->requestMatchers[$id];
|
||||
}
|
||||
|
||||
if ($methods) {
|
||||
$methods = array_map('strtoupper', (array) $methods);
|
||||
}
|
||||
|
||||
// only add arguments that are necessary
|
||||
$arguments = array($path, $host, $methods, $ip, $attributes);
|
||||
while (count($arguments) > 0 && !end($arguments)) {
|
||||
|
|
Reference in New Issue