From 92e330501bcbd6ecd6e18c863c67751c0dc1b3bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C5=A0pa=C4=8Dek?= Date: Mon, 22 Jan 2024 04:55:02 +0100 Subject: [PATCH] Reuse the existing reflection and do it just once --- src/Calls/NewCalls.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Calls/NewCalls.php b/src/Calls/NewCalls.php index 5b75a0f..7596e66 100644 --- a/src/Calls/NewCalls.php +++ b/src/Calls/NewCalls.php @@ -86,10 +86,9 @@ public function processNode(Node $node, Scope $scope): array $names[] = $interface->getName(); } } + $definedIn = $reflection ? $reflection->getFileName() : null; foreach ($names as $name) { - $classRef = $type->getClassReflection(); - $definedIn = $classRef ? $classRef->getFileName() : null; $name .= self::CONSTRUCT; $errors = array_merge( $errors,