diff --git a/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.php b/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.php index 94b833d657..7a5f15e9f5 100644 --- a/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.php +++ b/src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.php @@ -103,7 +103,7 @@ public function getErrorList($testFile='') ]; case 'DisallowTabIndentUnitTest.3.inc': - if (\PHP_VERSION_ID >= 70300) { + if (PHP_VERSION_ID >= 70300) { return [ 7 => 1, 13 => 1, diff --git a/src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php b/src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php index d4792f5e30..552bfea46a 100644 --- a/src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php +++ b/src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php @@ -98,7 +98,7 @@ public function process(File $phpcsFile, $stackPtr) $indent = str_repeat(' ', ($tokens[$first]['column'] - 1)); $phpcsFile->fixer->beginChangeset(); - if ($tokens[($prev + 1)]['code'] === \T_WHITESPACE) { + if ($tokens[($prev + 1)]['code'] === T_WHITESPACE) { $phpcsFile->fixer->replaceToken(($prev + 1), ''); } diff --git a/src/Standards/Squiz/Sniffs/PHP/InnerFunctionsSniff.php b/src/Standards/Squiz/Sniffs/PHP/InnerFunctionsSniff.php index 5ec0d470be..1bc369a2a0 100644 --- a/src/Standards/Squiz/Sniffs/PHP/InnerFunctionsSniff.php +++ b/src/Standards/Squiz/Sniffs/PHP/InnerFunctionsSniff.php @@ -56,7 +56,7 @@ public function process(File $phpcsFile, $stackPtr) break; } - if (\array_key_exists($condition, Tokens::$ooScopeTokens) === true) { + if (array_key_exists($condition, Tokens::$ooScopeTokens) === true) { // Ignore methods in OOP structures defined within functions. return; } diff --git a/src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php b/src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php index a5db965b66..4c0d6bcb7e 100644 --- a/src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php +++ b/src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php @@ -275,7 +275,7 @@ public function process(File $phpcsFile, $stackPtr) } // Skip HTML whitespace. - if ($tokens[$i]['code'] === T_INLINE_HTML && \trim($tokens[$i]['content']) === '') { + if ($tokens[$i]['code'] === T_INLINE_HTML && trim($tokens[$i]['content']) === '') { continue; } diff --git a/src/Tokenizers/PHP.php b/src/Tokenizers/PHP.php index 31cc0237a2..4be5400a05 100644 --- a/src/Tokenizers/PHP.php +++ b/src/Tokenizers/PHP.php @@ -3106,7 +3106,7 @@ protected function processAdditional() } if ($suspectedType === 'property or parameter') { - unset($allowed[\T_STATIC]); + unset($allowed[T_STATIC]); } $typeTokenCount = 0; diff --git a/tests/Core/AbstractMethodUnitTest.php b/tests/Core/AbstractMethodUnitTest.php index 9f7cefec17..b8522bf4bb 100644 --- a/tests/Core/AbstractMethodUnitTest.php +++ b/tests/Core/AbstractMethodUnitTest.php @@ -14,7 +14,6 @@ use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Tests\ConfigDouble; use PHPUnit\Framework\TestCase; -use ReflectionProperty; abstract class AbstractMethodUnitTest extends TestCase { diff --git a/tests/Core/File/GetClassPropertiesTest.php b/tests/Core/File/GetClassPropertiesTest.php index 1bebc5893f..4841b50b6b 100644 --- a/tests/Core/File/GetClassPropertiesTest.php +++ b/tests/Core/File/GetClassPropertiesTest.php @@ -52,15 +52,15 @@ public static function dataNotAClassException() return [ 'interface' => [ 'testMarker' => '/* testNotAClass */', - 'tokenType' => \T_INTERFACE, + 'tokenType' => T_INTERFACE, ], 'anon-class' => [ 'testMarker' => '/* testAnonClass */', - 'tokenType' => \T_ANON_CLASS, + 'tokenType' => T_ANON_CLASS, ], 'enum' => [ 'testMarker' => '/* testEnum */', - 'tokenType' => \T_ENUM, + 'tokenType' => T_ENUM, ], ]; @@ -79,7 +79,7 @@ public static function dataNotAClassException() */ public function testGetClassProperties($testMarker, $expected) { - $class = $this->getTargetToken($testMarker, \T_CLASS); + $class = $this->getTargetToken($testMarker, T_CLASS); $result = self::$phpcsFile->getClassProperties($class); $this->assertSame($expected, $result); diff --git a/tests/Core/Filters/AbstractFilterTestCase.php b/tests/Core/Filters/AbstractFilterTestCase.php index 9091d1998e..762814e359 100644 --- a/tests/Core/Filters/AbstractFilterTestCase.php +++ b/tests/Core/Filters/AbstractFilterTestCase.php @@ -73,7 +73,7 @@ protected function getMockedClass($className, array $constructorArgs=[], $method { $mockedObj = $this->getMockBuilder($className); - if (\method_exists($mockedObj, 'onlyMethods') === true) { + if (method_exists($mockedObj, 'onlyMethods') === true) { // PHPUnit 8+. if (is_array($methodsToMock) === true) { return $mockedObj diff --git a/tests/Core/Filters/Filter/AcceptTest.php b/tests/Core/Filters/Filter/AcceptTest.php index 64765f3af0..8d622061df 100644 --- a/tests/Core/Filters/Filter/AcceptTest.php +++ b/tests/Core/Filters/Filter/AcceptTest.php @@ -10,7 +10,6 @@ namespace PHP_CodeSniffer\Tests\Core\Filters\Filter; -use PHP_CodeSniffer\Config; use PHP_CodeSniffer\Filters\Filter; use PHP_CodeSniffer\Ruleset; use PHP_CodeSniffer\Tests\ConfigDouble;