From e8a05a0d87a00594dd323c2a5aec3474599f37d4 Mon Sep 17 00:00:00 2001 From: HypeMC Date: Wed, 3 Sep 2025 13:15:42 +0200 Subject: [PATCH] [DependencyInjection] Optimize `AutowireRequiredMethodsPass` --- .../Compiler/AutowireRequiredMethodsPass.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/DependencyInjection/Compiler/AutowireRequiredMethodsPass.php b/src/Symfony/Component/DependencyInjection/Compiler/AutowireRequiredMethodsPass.php index 9c42280153489..22c5ef16d7a16 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/AutowireRequiredMethodsPass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/AutowireRequiredMethodsPass.php @@ -57,11 +57,10 @@ protected function processValue(mixed $value, bool $isRoot = false): mixed } break; } - try { - $r = $r->getPrototype(); - } catch (\ReflectionException) { - break; // method has no prototype + if (!$r->hasPrototype()) { + break; } + $r = $r->getPrototype(); } }