Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / psy / psysh / src / TabCompletion / Matcher / AbstractMatcher.php
index efa9e57e49c44178d71211eba44b55894dd0a622..63b7154738492477604628cbc929d7b7f73cfd74 100644 (file)
@@ -64,7 +64,7 @@ abstract class AbstractMatcher
     protected function getInput(array $tokens)
     {
         $var = '';
-        $firstToken = array_pop($tokens);
+        $firstToken = \array_pop($tokens);
         if (self::tokenIs($firstToken, self::T_STRING)) {
             $var = $firstToken[1];
         }
@@ -84,7 +84,7 @@ abstract class AbstractMatcher
         $class = '';
         while (self::hasToken(
             [self::T_NS_SEPARATOR, self::T_STRING],
-            $token = array_pop($tokens)
+            $token = \array_pop($tokens)
         )) {
             if (self::needCompleteClass($token)) {
                 continue;
@@ -116,7 +116,7 @@ abstract class AbstractMatcher
      */
     public static function startsWith($prefix, $word)
     {
-        return preg_match(sprintf('#^%s#', $prefix), $word);
+        return \preg_match(\sprintf('#^%s#', $prefix), $word);
     }
 
     /**
@@ -129,13 +129,13 @@ abstract class AbstractMatcher
      */
     public static function hasSyntax($token, $syntax = self::VAR_SYNTAX)
     {
-        if (!is_array($token)) {
+        if (!\is_array($token)) {
             return false;
         }
 
-        $regexp = sprintf('#%s#', $syntax);
+        $regexp = \sprintf('#%s#', $syntax);
 
-        return (bool) preg_match($regexp, $token[1]);
+        return (bool) \preg_match($regexp, $token[1]);
     }
 
     /**
@@ -148,11 +148,11 @@ abstract class AbstractMatcher
      */
     public static function tokenIs($token, $which)
     {
-        if (!is_array($token)) {
+        if (!\is_array($token)) {
             return false;
         }
 
-        return token_name($token[0]) === $which;
+        return \token_name($token[0]) === $which;
     }
 
     /**
@@ -164,16 +164,16 @@ abstract class AbstractMatcher
      */
     public static function isOperator($token)
     {
-        if (!is_string($token)) {
+        if (!\is_string($token)) {
             return false;
         }
 
-        return strpos(self::MISC_OPERATORS, $token) !== false;
+        return \strpos(self::MISC_OPERATORS, $token) !== false;
     }
 
     public static function needCompleteClass($token)
     {
-        return in_array($token[1], ['doc', 'ls', 'show']);
+        return \in_array($token[1], ['doc', 'ls', 'show']);
     }
 
     /**
@@ -186,10 +186,10 @@ abstract class AbstractMatcher
      */
     public static function hasToken(array $coll, $token)
     {
-        if (!is_array($token)) {
+        if (!\is_array($token)) {
             return false;
         }
 
-        return in_array(token_name($token[0]), $coll);
+        return \in_array(\token_name($token[0]), $coll);
     }
 }