From a84be6465ddb8d3ee098f29bdc8978dc4cd6645d Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Mon, 27 Nov 2023 13:27:23 +0100 Subject: [PATCH] Test --- .../Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php | 3 +++ .../MethodGetCompletionItemsForClassishThingTest.php | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php b/src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php index bc0f61bb1..64eb5550b 100644 --- a/src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php +++ b/src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php @@ -641,6 +641,9 @@ final class ClassLikeNodeScanner if (!isset($storage->overridden_method_ids[$lc_method_name])) { $storage->overridden_method_ids[$lc_method_name] = []; } + if (!isset($storage->declaring_method_ids[$lc_method_name])) { + $storage->declaring_method_ids[$lc_method_name] = $method_identifier; + } $storage->declaring_pseudo_method_ids[$lc_method_name] = $method_identifier; } diff --git a/tests/Internal/Codebase/MethodGetCompletionItemsForClassishThingTest.php b/tests/Internal/Codebase/MethodGetCompletionItemsForClassishThingTest.php index 836e7ae0f..ea48ce571 100644 --- a/tests/Internal/Codebase/MethodGetCompletionItemsForClassishThingTest.php +++ b/tests/Internal/Codebase/MethodGetCompletionItemsForClassishThingTest.php @@ -126,6 +126,7 @@ final class MethodGetCompletionItemsForClassishThingTest extends TestCase 'magicObjProp2', 'magicObjMethod', + 'magicStaticMethod', 'publicObjProp', 'protectedObjProp', @@ -201,6 +202,8 @@ final class MethodGetCompletionItemsForClassishThingTest extends TestCase 'magicObjMethod', + 'magicStaticMethod', + 'publicObjProp', 'protectedObjProp', 'privateObjProp', @@ -281,6 +284,7 @@ final class MethodGetCompletionItemsForClassishThingTest extends TestCase 'magicObjProp2', 'magicObjMethod', + 'magicStaticMethod', 'publicObjProp', 'protectedObjProp', @@ -361,6 +365,7 @@ final class MethodGetCompletionItemsForClassishThingTest extends TestCase 'magicObjProp2', 'magicObjMethod', + 'magicStaticMethod', 'publicObjProp', 'protectedObjProp', @@ -543,6 +548,7 @@ final class MethodGetCompletionItemsForClassishThingTest extends TestCase 'magicObjProp1', 'magicObjProp2', 'magicObjMethod', + 'magicStaticMethod', 'publicObjProp',