Skip to content

Commit 58de93d

Browse files
AntoineDlychalasr
authored andcommitted
[Security] remove deprecated conditions in supports and authenticate methods from AccessListener class
1 parent 08a7ea1 commit 58de93d

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

Firewall/AccessListener.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,7 @@ public function supports(Request $request): ?bool
5050
[$attributes] = $this->map->getPatterns($request);
5151
$request->attributes->set('_access_control_attributes', $attributes);
5252

53-
if ($attributes && (
54-
(\defined(AuthenticatedVoter::class.'::IS_AUTHENTICATED_ANONYMOUSLY') ? [AuthenticatedVoter::IS_AUTHENTICATED_ANONYMOUSLY] !== $attributes : true)
55-
&& [AuthenticatedVoter::PUBLIC_ACCESS] !== $attributes
56-
)) {
53+
if ($attributes && [AuthenticatedVoter::PUBLIC_ACCESS] !== $attributes) {
5754
return true;
5855
}
5956

@@ -72,10 +69,9 @@ public function authenticate(RequestEvent $event)
7269
$attributes = $request->attributes->get('_access_control_attributes');
7370
$request->attributes->remove('_access_control_attributes');
7471

75-
if (!$attributes || ((
76-
(\defined(AuthenticatedVoter::class.'::IS_AUTHENTICATED_ANONYMOUSLY') ? [AuthenticatedVoter::IS_AUTHENTICATED_ANONYMOUSLY] === $attributes : false)
77-
|| [AuthenticatedVoter::PUBLIC_ACCESS] === $attributes
78-
) && $event instanceof LazyResponseEvent)) {
72+
if (!$attributes || (
73+
[AuthenticatedVoter::PUBLIC_ACCESS] === $attributes && $event instanceof LazyResponseEvent
74+
)) {
7975
return;
8076
}
8177

0 commit comments

Comments
 (0)