Skip to content

Commit b70e37f

Browse files
minor #61112 [HttpKernel][Security] Refactor: use getAttributes with argument (santysisi)
This PR was merged into the 7.4 branch. Discussion ---------- [HttpKernel][Security] Refactor: use `getAttributes` with argument | Q | A | ------------- | --- | Branch? | 7.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | no | License | MIT Refactored code to consistently use `$event->getAttributes($className)` instead of accessing the full array. This simplifies attribute retrieval and improves readability. [Reference](symfony/symfony#60395 (comment)) Commits ------- 6769c9a8287 [HttpKernel][Security] Refactor: use `getAttributes` with argument
2 parents add24c0 + 02cce08 commit b70e37f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

EventListener/CacheAttributeListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function onKernelControllerArguments(ControllerArgumentsEvent $event): vo
5151
{
5252
$request = $event->getRequest();
5353

54-
if (!\is_array($attributes = $request->attributes->get('_cache') ?? $event->getAttributes()[Cache::class] ?? null)) {
54+
if (!$attributes = $request->attributes->get('_cache') ?? $event->getAttributes(Cache::class)) {
5555
return;
5656
}
5757

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy