diff vendor/psy/psysh/src/TabCompletion/Matcher/ClassMethodsMatcher.php @ 16:c2387f117808

Routine composer update
author Chris Cannam
date Tue, 10 Jul 2018 15:07:59 +0100
parents 5fb285c0d0e3
children 129ea1e6d783
line wrap: on
line diff
--- a/vendor/psy/psysh/src/TabCompletion/Matcher/ClassMethodsMatcher.php	Thu Apr 26 11:26:54 2018 +0100
+++ b/vendor/psy/psysh/src/TabCompletion/Matcher/ClassMethodsMatcher.php	Tue Jul 10 15:07:59 2018 +0100
@@ -42,14 +42,22 @@
             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);