Updated from some -dev modules to alpha, beta or full releases
[yaffs-website] / vendor / psy / psysh / src / TabCompletion / Matcher / ClassMethodsMatcher.php
index e1b4053c1f2f663ab0d8c5d52c989cbdd66d8804..2aba6dc1a8cb26fa91abde024416c1855f2d9f08 100644 (file)
@@ -42,14 +42,22 @@ class ClassMethodsMatcher extends AbstractMatcher
             return [];
         }
 
-        $methods = $reflection->getMethods(\ReflectionMethod::IS_STATIC);
+        if (self::needCompleteClass($tokens[1])) {
+            $methods = $reflection->getMethods();
+        } else {
+            $methods = $reflection->getMethods(\ReflectionMethod::IS_STATIC);
+        }
+
         $methods = array_map(function (\ReflectionMethod $method) {
             return $method->getName();
         }, $methods);
 
         return array_map(
             function ($name) use ($class) {
-                return $class . '::' . $name;
+                $chunks = explode('\\', $class);
+                $className = array_pop($chunks);
+
+                return $className . '::' . $name;
             },
             array_filter($methods, function ($method) use ($input) {
                 return AbstractMatcher::startsWith($input, $method);