1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Resolve testReferencedMethods

Resolved problem:
```
FileReferenceTest::testReferencedMethods with data set "getClassReferences"
Failed asserting that two arrays are identical.
--- Expected
+++ Actual
@@ @@
         'foo\b::__construct' => true
         'foo\c::foo' => true
     )
-    'foo\c::__construct' => Array &2 (
+    'foo\a::__callstatic' => Array &2 (
+        'foo\b::__construct' => true
+    )
+    'foo\c::__construct' => Array &3 (
         'foo\b::bar' => true
     )
 )
 ```
This commit is contained in:
Ivan Sidorov 2024-01-31 21:26:00 +00:00
parent 2567a99347
commit df2067dd74

View File

@ -567,20 +567,7 @@ final class AtomicStaticCallAnalyzer
'__callstatic',
);
$callstatic_method_exists = $codebase->methods->methodExists(
$callstatic_id,
$context->calling_method_id,
$codebase->collect_locations
? new CodeLocation($statements_analyzer, $stmt_name)
: null,
!$context->collect_initializations
&& !$context->collect_mutations
? $statements_analyzer
: null,
$statements_analyzer->getFilePath(),
true,
$context->insideUse(),
);
$callstatic_method_exists = $codebase->methods->methodExists($callstatic_id);
if (!$naive_method_exists
|| !MethodAnalyzer::isMethodVisible(