diff --git a/src/Symfony/Component/HttpKernel/EventListener/CacheAttributeListener.php b/src/Symfony/Component/HttpKernel/EventListener/CacheAttributeListener.php index 02b378c8faa20..c490689fc83d5 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/CacheAttributeListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/CacheAttributeListener.php @@ -51,7 +51,7 @@ public function onKernelControllerArguments(ControllerArgumentsEvent $event): vo { $request = $event->getRequest(); - if (!\is_array($attributes = $request->attributes->get('_cache') ?? $event->getAttributes()[Cache::class] ?? null)) { + if (!$attributes = $request->attributes->get('_cache') ?? $event->getAttributes(Cache::class)) { return; } diff --git a/src/Symfony/Component/Security/Http/EventListener/IsCsrfTokenValidAttributeListener.php b/src/Symfony/Component/Security/Http/EventListener/IsCsrfTokenValidAttributeListener.php index 336b794f512a0..5d877db46bc35 100644 --- a/src/Symfony/Component/Security/Http/EventListener/IsCsrfTokenValidAttributeListener.php +++ b/src/Symfony/Component/Security/Http/EventListener/IsCsrfTokenValidAttributeListener.php @@ -35,8 +35,7 @@ public function __construct( public function onKernelControllerArguments(ControllerArgumentsEvent $event): void { - /** @var IsCsrfTokenValid[] $attributes */ - if (!\is_array($attributes = $event->getAttributes()[IsCsrfTokenValid::class] ?? null)) { + if (!$attributes = $event->getAttributes(IsCsrfTokenValid::class)) { return; } diff --git a/src/Symfony/Component/Security/Http/EventListener/IsGrantedAttributeListener.php b/src/Symfony/Component/Security/Http/EventListener/IsGrantedAttributeListener.php index 607643cef3d5c..127e631837018 100644 --- a/src/Symfony/Component/Security/Http/EventListener/IsGrantedAttributeListener.php +++ b/src/Symfony/Component/Security/Http/EventListener/IsGrantedAttributeListener.php @@ -39,8 +39,7 @@ public function __construct( public function onKernelControllerArguments(ControllerArgumentsEvent $event): void { - /** @var IsGranted[] $attributes */ - if (!\is_array($attributes = $event->getAttributes()[IsGranted::class] ?? null)) { + if (!$attributes = $event->getAttributes(IsGranted::class)) { return; }