Security update for Core, with self-updated composer
[yaffs-website] / vendor / psy / psysh / src / Psy / TabCompletion / Matcher / ClassMethodsMatcher.php
index 6045ed94e32119f6b7c8399f7bebc79a50319867..fa734fde981aece68588eaa69eb43ec7a8f1d120 100644 (file)
@@ -36,7 +36,12 @@ class ClassMethodsMatcher extends AbstractMatcher
 
         $class = $this->getNamespaceAndClass($tokens);
 
-        $reflection = new \ReflectionClass($class);
+        try {
+            $reflection = new \ReflectionClass($class);
+        } catch (\ReflectionException $re) {
+            return array();
+        }
+
         $methods = $reflection->getMethods(\ReflectionMethod::IS_STATIC);
         $methods = array_map(function (\ReflectionMethod $method) {
             return $method->getName();
@@ -57,7 +62,7 @@ class ClassMethodsMatcher extends AbstractMatcher
      */
     public function hasMatched(array $tokens)
     {
-        $token = array_pop($tokens);
+        $token     = array_pop($tokens);
         $prevToken = array_pop($tokens);
 
         switch (true) {