diff --git a/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeKeywordSpacingSniff.php b/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeKeywordSpacingSniff.php index e0fab85a8d..8d5a1f3bbd 100644 --- a/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeKeywordSpacingSniff.php +++ b/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeKeywordSpacingSniff.php @@ -53,7 +53,8 @@ public function process(File $phpcsFile, $stackPtr) if ($tokens[$stackPtr]['code'] === T_STATIC && (($nextToken === false || $tokens[$nextToken]['code'] === T_DOUBLE_COLON) - || $tokens[$prevToken]['code'] === T_NEW) + || $tokens[$prevToken]['code'] === T_NEW + || $tokens[$prevToken]['code'] === T_INSTANCEOF) ) { // Late static binding, e.g., static:: OR new static() usage or live coding. return; diff --git a/src/Tokenizers/PHP.php b/src/Tokenizers/PHP.php index 6bb252d7d9..304e8d2858 100644 --- a/src/Tokenizers/PHP.php +++ b/src/Tokenizers/PHP.php @@ -2184,24 +2184,6 @@ protected function processAdditional() } } - continue; - } else if ($this->tokens[$i]['code'] === T_STATIC) { - for ($x = ($i - 1); $x > 0; $x--) { - if (isset(Tokens::$emptyTokens[$this->tokens[$x]['code']]) === false) { - break; - } - } - - if ($this->tokens[$x]['code'] === T_INSTANCEOF) { - $this->tokens[$i]['code'] = T_STRING; - $this->tokens[$i]['type'] = 'T_STRING'; - - if (PHP_CODESNIFFER_VERBOSITY > 1) { - $line = $this->tokens[$i]['line']; - Common::printStatusMessage("* token $i on line $line changed from T_STATIC to T_STRING", 1); - } - } - continue; } else if ($this->tokens[$i]['code'] === T_TRUE || $this->tokens[$i]['code'] === T_FALSE