From e8d207cd12416abb58acaba5358139c7f077b40b Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Sun, 22 May 2016 18:08:36 -0400 Subject: [PATCH] Support passing string types --- src/CodeInspector/FunctionChecker.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/CodeInspector/FunctionChecker.php b/src/CodeInspector/FunctionChecker.php index ede90e01d..99cc4a2d8 100644 --- a/src/CodeInspector/FunctionChecker.php +++ b/src/CodeInspector/FunctionChecker.php @@ -49,7 +49,7 @@ class FunctionChecker implements StatementsSource } } - $statements_checker = new StatementsChecker($this, !empty($this->_function->params)); + $statements_checker = new StatementsChecker($this, ClassChecker::getThisClass() || !empty($this->_function->params)); foreach ($this->_function->params as $param) { if ($param->type) { @@ -75,8 +75,8 @@ class FunctionChecker implements StatementsSource $vars_in_scope[$param->name] .= '|null'; } } - else { - $vars_in_scope[$param->name] = 'mixed'; + elseif (is_string($param->type)) { + $vars_in_scope[$param->name] = $param->type; } $vars_possibly_in_scope[$param->name] = true;