From c395930a0622c206614699c37278ba024f170456 Mon Sep 17 00:00:00 2001 From: Matt Brown Date: Thu, 19 Oct 2017 18:23:18 -0400 Subject: [PATCH] Fix missing function issue ref #251 --- src/Psalm/Checker/FunctionChecker.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Psalm/Checker/FunctionChecker.php b/src/Psalm/Checker/FunctionChecker.php index d2e2dc10b..4caa222e6 100644 --- a/src/Psalm/Checker/FunctionChecker.php +++ b/src/Psalm/Checker/FunctionChecker.php @@ -672,6 +672,11 @@ class FunctionChecker extends FunctionLikeChecker continue; } + if (!MethodChecker::methodExists($project_checker, $mapping_function_id)) { + $mapping_return_type = Type::getMixed(); + continue; + } + $return_type = MethodChecker::getMethodReturnType( $project_checker, $mapping_function_id @@ -686,6 +691,11 @@ class FunctionChecker extends FunctionLikeChecker $mapping_return_type = $return_type; } } else { + if (!FunctionChecker::functionExists($statements_checker, $mapping_function_id)) { + $mapping_return_type = Type::getMixed(); + continue; + } + $function_storage = FunctionChecker::getStorage( $statements_checker, $mapping_function_id