From 24980cd7d7e165fdc2871b1202794b3c4909ba0e Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Sat, 28 Oct 2017 16:05:35 -0400 Subject: [PATCH] Constrain user-defined functions and methods --- src/Psalm/Checker/Statements/Expression/CallChecker.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Psalm/Checker/Statements/Expression/CallChecker.php b/src/Psalm/Checker/Statements/Expression/CallChecker.php index e1e80d0bf..8893facfd 100644 --- a/src/Psalm/Checker/Statements/Expression/CallChecker.php +++ b/src/Psalm/Checker/Statements/Expression/CallChecker.php @@ -1679,7 +1679,8 @@ class CallChecker $statements_checker, $arg->value, $by_ref_type, - $context + $context, + $method_id && (strpos('::', $method_id) !== false || !FunctionChecker::inCallMap($method_id)) ); } else { if ($arg->value instanceof PhpParser\Node\Expr\Variable) {