minor #13103 [SecurityBundle] avoid unneeded work (fabpot)
This PR was merged into the 2.3 branch.
Discussion
----------
[SecurityBundle] avoid unneeded work
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #13018
| License | MIT
| Doc PR | n/a
Commits
-------
8135727
[SecurityBundle] avoid unneeded work
This commit is contained in:
commit
49dd88ff86
@ -567,6 +567,10 @@ class SecurityExtension extends Extension
|
|||||||
|
|
||||||
private function createRequestMatcher($container, $path = null, $host = null, $methods = array(), $ip = null, array $attributes = array())
|
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));
|
$serialized = serialize(array($path, $host, $methods, $ip, $attributes));
|
||||||
$id = 'security.request_matcher.'.md5($serialized).sha1($serialized);
|
$id = 'security.request_matcher.'.md5($serialized).sha1($serialized);
|
||||||
|
|
||||||
@ -574,10 +578,6 @@ class SecurityExtension extends Extension
|
|||||||
return $this->requestMatchers[$id];
|
return $this->requestMatchers[$id];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($methods) {
|
|
||||||
$methods = array_map('strtoupper', (array) $methods);
|
|
||||||
}
|
|
||||||
|
|
||||||
// only add arguments that are necessary
|
// only add arguments that are necessary
|
||||||
$arguments = array($path, $host, $methods, $ip, $attributes);
|
$arguments = array($path, $host, $methods, $ip, $attributes);
|
||||||
while (count($arguments) > 0 && !end($arguments)) {
|
while (count($arguments) > 0 && !end($arguments)) {
|
||||||
|
Reference in New Issue
Block a user