From 1bd61e89af8bf3cf42557fe55460fea0491bdc1d Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Mon, 9 May 2016 15:58:48 -0400 Subject: [PATCH] Treat self as absolute calss --- src/CodeInspector/ClassMethodChecker.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/CodeInspector/ClassMethodChecker.php b/src/CodeInspector/ClassMethodChecker.php index 7c7d4eecc..b85fe5c56 100644 --- a/src/CodeInspector/ClassMethodChecker.php +++ b/src/CodeInspector/ClassMethodChecker.php @@ -348,8 +348,11 @@ class ClassMethodChecker extends FunctionChecker else { if ($param->type instanceof PhpParser\Node\Name\FullyQualified) { $param_type = implode('\\', $param->type->parts); - } - else { + + } elseif ($param->type->parts === ['self']) { + $param_type = $this->_absolute_class; + + } else { $param_type = ClassChecker::getAbsoluteClassFromString(implode('\\', $param->type->parts), $this->_namespace, $this->_aliased_classes); } }