diff vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractPatternSniff.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents a9cd425dd02b
children
line wrap: on
line diff
--- a/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractPatternSniff.php	Thu Feb 28 13:11:55 2019 +0000
+++ b/vendor/squizlabs/php_codesniffer/src/Sniffs/AbstractPatternSniff.php	Thu May 09 15:34:47 2019 +0100
@@ -153,7 +153,7 @@
      *
      * @return int The position in the pattern that this test should register
      *             as the listener.
-     * @throws RuntimeException If we could not determine a token to listen for.
+     * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If we could not determine a token to listen for.
      */
     private function getListenerTokenPos($pattern)
     {
@@ -195,7 +195,7 @@
 
         $tokens = $phpcsFile->getTokens();
 
-        if (in_array($tokens[$stackPtr]['code'], $this->supplementaryTokens) === true) {
+        if (in_array($tokens[$stackPtr]['code'], $this->supplementaryTokens, true) === true) {
             $this->processSupplementary($phpcsFile, $stackPtr);
         }
 
@@ -260,10 +260,9 @@
         $errors      = [];
         $found       = '';
 
-        $ignoreTokens = [T_WHITESPACE];
+        $ignoreTokens = [T_WHITESPACE => T_WHITESPACE];
         if ($this->ignoreComments === true) {
-            $ignoreTokens
-                = array_merge($ignoreTokens, Tokens::$commentTokens);
+            $ignoreTokens += Tokens::$commentTokens;
         }
 
         $origStackPtr = $stackPtr;