Skip to content

Commit b33e6f8

Browse files
committed
Fix redeclaration of InternalSecurity class when opcache preload is active
1 parent b6ae3aa commit b33e6f8

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/Symfony/Bundle/SecurityBundle/Security.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,16 @@
3030
use Symfony\Component\Security\Http\SecurityRequestAttributes;
3131
use Symfony\Contracts\Service\ServiceProviderInterface;
3232

33-
if (class_exists(LegacySecurity::class)) {
34-
class_alias(LegacySecurity::class, InternalSecurity::class);
35-
} else {
36-
/**
37-
* @internal
38-
*/
39-
class InternalSecurity
40-
{
33+
if (!class_exists(InternalSecurity::class, false)) {
34+
if (class_exists(LegacySecurity::class)) {
35+
class_alias(LegacySecurity::class, InternalSecurity::class);
36+
} else {
37+
/**
38+
* @internal
39+
*/
40+
class InternalSecurity
41+
{
42+
}
4143
}
4244
}
4345

0 commit comments

Comments
 (0)