Skip to content

Commit 3e582fe

Browse files
authored
Merge pull request #339 from PHPCSStandards/feature/various-minor-cs-cleanup
CS: various minor fixes
2 parents 814896b + 479b4dc commit 3e582fe

File tree

9 files changed

+10
-12
lines changed

9 files changed

+10
-12
lines changed

src/Standards/Generic/Tests/WhiteSpace/DisallowTabIndentUnitTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function getErrorList($testFile='')
103103
];
104104

105105
case 'DisallowTabIndentUnitTest.3.inc':
106-
if (\PHP_VERSION_ID >= 70300) {
106+
if (PHP_VERSION_ID >= 70300) {
107107
return [
108108
7 => 1,
109109
13 => 1,

src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function process(File $phpcsFile, $stackPtr)
9898
$indent = str_repeat(' ', ($tokens[$first]['column'] - 1));
9999
$phpcsFile->fixer->beginChangeset();
100100

101-
if ($tokens[($prev + 1)]['code'] === \T_WHITESPACE) {
101+
if ($tokens[($prev + 1)]['code'] === T_WHITESPACE) {
102102
$phpcsFile->fixer->replaceToken(($prev + 1), '');
103103
}
104104

src/Standards/Squiz/Sniffs/PHP/InnerFunctionsSniff.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function process(File $phpcsFile, $stackPtr)
5656
break;
5757
}
5858

59-
if (\array_key_exists($condition, Tokens::$ooScopeTokens) === true) {
59+
if (array_key_exists($condition, Tokens::$ooScopeTokens) === true) {
6060
// Ignore methods in OOP structures defined within functions.
6161
return;
6262
}

src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ public function process(File $phpcsFile, $stackPtr)
275275
}
276276

277277
// Skip HTML whitespace.
278-
if ($tokens[$i]['code'] === T_INLINE_HTML && \trim($tokens[$i]['content']) === '') {
278+
if ($tokens[$i]['code'] === T_INLINE_HTML && trim($tokens[$i]['content']) === '') {
279279
continue;
280280
}
281281

src/Tokenizers/PHP.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3106,7 +3106,7 @@ protected function processAdditional()
31063106
}
31073107

31083108
if ($suspectedType === 'property or parameter') {
3109-
unset($allowed[\T_STATIC]);
3109+
unset($allowed[T_STATIC]);
31103110
}
31113111

31123112
$typeTokenCount = 0;

tests/Core/AbstractMethodUnitTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use PHP_CodeSniffer\Files\File;
1515
use PHP_CodeSniffer\Tests\ConfigDouble;
1616
use PHPUnit\Framework\TestCase;
17-
use ReflectionProperty;
1817

1918
abstract class AbstractMethodUnitTest extends TestCase
2019
{

tests/Core/File/GetClassPropertiesTest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ public static function dataNotAClassException()
5252
return [
5353
'interface' => [
5454
'testMarker' => '/* testNotAClass */',
55-
'tokenType' => \T_INTERFACE,
55+
'tokenType' => T_INTERFACE,
5656
],
5757
'anon-class' => [
5858
'testMarker' => '/* testAnonClass */',
59-
'tokenType' => \T_ANON_CLASS,
59+
'tokenType' => T_ANON_CLASS,
6060
],
6161
'enum' => [
6262
'testMarker' => '/* testEnum */',
63-
'tokenType' => \T_ENUM,
63+
'tokenType' => T_ENUM,
6464
],
6565
];
6666

@@ -79,7 +79,7 @@ public static function dataNotAClassException()
7979
*/
8080
public function testGetClassProperties($testMarker, $expected)
8181
{
82-
$class = $this->getTargetToken($testMarker, \T_CLASS);
82+
$class = $this->getTargetToken($testMarker, T_CLASS);
8383
$result = self::$phpcsFile->getClassProperties($class);
8484
$this->assertSame($expected, $result);
8585

tests/Core/Filters/AbstractFilterTestCase.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ protected function getMockedClass($className, array $constructorArgs=[], $method
7373
{
7474
$mockedObj = $this->getMockBuilder($className);
7575

76-
if (\method_exists($mockedObj, 'onlyMethods') === true) {
76+
if (method_exists($mockedObj, 'onlyMethods') === true) {
7777
// PHPUnit 8+.
7878
if (is_array($methodsToMock) === true) {
7979
return $mockedObj

tests/Core/Filters/Filter/AcceptTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
namespace PHP_CodeSniffer\Tests\Core\Filters\Filter;
1212

13-
use PHP_CodeSniffer\Config;
1413
use PHP_CodeSniffer\Filters\Filter;
1514
use PHP_CodeSniffer\Ruleset;
1615
use PHP_CodeSniffer\Tests\ConfigDouble;

0 commit comments

Comments
 (0)