Skip to content

Commit

Permalink
Handle taking references to unspecified magic methods
Browse files Browse the repository at this point in the history
  • Loading branch information
weirdan committed Feb 11, 2024
1 parent d10e384 commit a8c093a
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,19 @@ private static function handleNamedCall(
$codebase->getMethodReturnType($method_id, $fq_class_name),
$codebase->methods->getStorage($declaring_method_id)->pure,
)]);
} elseif ($codebase->methodExists(
$call_static_method_id = new MethodIdentifier($method_id->fq_class_name, '__callstatic'),
new CodeLocation($statements_analyzer, $stmt),
null,
null,
false,
)) {
$return_type_candidate = new Union([new TClosure(
'Closure',
null,
$codebase->getMethodReturnType($call_static_method_id, $fq_class_name),
$codebase->methods->getStorage($call_static_method_id)->pure,
)]);
} else {
if (IssueBuffer::accepts(
new UndefinedMethod(
Expand Down

0 comments on commit a8c093a

Please sign in to comment.