diff --git a/PHPCSUtils/Tokens/Collections.php b/PHPCSUtils/Tokens/Collections.php index a84846f0..c8465152 100644 --- a/PHPCSUtils/Tokens/Collections.php +++ b/PHPCSUtils/Tokens/Collections.php @@ -596,13 +596,7 @@ private static function triggerDeprecation($method, $version, $replacement) */ public static function arrayOpenTokensBC() { - $tokens = self::$arrayOpenTokensBC; - - if (\version_compare(Helper::getVersion(), '3.7.1', '<=')) { - $tokens[\T_OPEN_SQUARE_BRACKET] = \T_OPEN_SQUARE_BRACKET; - } - - return $tokens; + return self::$arrayOpenTokensBC; } /** @@ -623,14 +617,7 @@ public static function arrayOpenTokensBC() */ public static function arrayTokensBC() { - $tokens = self::$arrayTokens; - - if (\version_compare(Helper::getVersion(), '3.7.1', '<=')) { - $tokens[\T_OPEN_SQUARE_BRACKET] = \T_OPEN_SQUARE_BRACKET; - $tokens[\T_CLOSE_SQUARE_BRACKET] = \T_CLOSE_SQUARE_BRACKET; - } - - return $tokens; + return self::$arrayTokens; } /** @@ -673,13 +660,7 @@ public static function functionCallTokens() */ public static function listOpenTokensBC() { - $tokens = self::$listOpenTokensBC; - - if (\version_compare(Helper::getVersion(), '3.7.1', '<=')) { - $tokens[\T_OPEN_SQUARE_BRACKET] = \T_OPEN_SQUARE_BRACKET; - } - - return $tokens; + return self::$listOpenTokensBC; } /** @@ -698,14 +679,7 @@ public static function listOpenTokensBC() */ public static function listTokensBC() { - $tokens = self::$listTokens; - - if (\version_compare(Helper::getVersion(), '3.7.1', '<=')) { - $tokens[\T_OPEN_SQUARE_BRACKET] = \T_OPEN_SQUARE_BRACKET; - $tokens[\T_CLOSE_SQUARE_BRACKET] = \T_CLOSE_SQUARE_BRACKET; - } - - return $tokens; + return self::$listTokens; } /** @@ -815,13 +789,7 @@ public static function returnTypeTokens() */ public static function shortArrayListOpenTokensBC() { - $tokens = self::$shortArrayListOpenTokensBC; - - if (\version_compare(Helper::getVersion(), '3.7.1', '<=')) { - $tokens[\T_OPEN_SQUARE_BRACKET] = \T_OPEN_SQUARE_BRACKET; - } - - return $tokens; + return self::$shortArrayListOpenTokensBC; } /** @@ -840,14 +808,7 @@ public static function shortArrayListOpenTokensBC() */ public static function shortArrayTokensBC() { - $tokens = self::$shortArrayTokens; - - if (\version_compare(Helper::getVersion(), '3.7.1', '<=')) { - $tokens[\T_OPEN_SQUARE_BRACKET] = \T_OPEN_SQUARE_BRACKET; - $tokens[\T_CLOSE_SQUARE_BRACKET] = \T_CLOSE_SQUARE_BRACKET; - } - - return $tokens; + return self::$shortArrayTokens; } /** @@ -866,13 +827,6 @@ public static function shortArrayTokensBC() */ public static function shortListTokensBC() { - $tokens = self::$shortListTokens; - - if (\version_compare(Helper::getVersion(), '3.7.1', '<=')) { - $tokens[\T_OPEN_SQUARE_BRACKET] = \T_OPEN_SQUARE_BRACKET; - $tokens[\T_CLOSE_SQUARE_BRACKET] = \T_CLOSE_SQUARE_BRACKET; - } - - return $tokens; + return self::$shortListTokens; } } diff --git a/Tests/Tokens/Collections/ArrayOpenTokensBCTest.php b/Tests/Tokens/Collections/ArrayOpenTokensBCTest.php index 12568b4e..2f581b75 100644 --- a/Tests/Tokens/Collections/ArrayOpenTokensBCTest.php +++ b/Tests/Tokens/Collections/ArrayOpenTokensBCTest.php @@ -38,10 +38,6 @@ public function testArrayOpenTokensBC() \T_OPEN_SHORT_ARRAY => \T_OPEN_SHORT_ARRAY, ]; - if (\version_compare(Helper::getVersion(), '3.7.1', '<=')) { - $expected[\T_OPEN_SQUARE_BRACKET] = \T_OPEN_SQUARE_BRACKET; - } - $this->assertSame($expected, Collections::arrayOpenTokensBC()); } } diff --git a/Tests/Tokens/Collections/ArrayTokensBCTest.php b/Tests/Tokens/Collections/ArrayTokensBCTest.php index 009b825e..7a5be5ba 100644 --- a/Tests/Tokens/Collections/ArrayTokensBCTest.php +++ b/Tests/Tokens/Collections/ArrayTokensBCTest.php @@ -39,11 +39,6 @@ public function testArrayTokensBC() \T_CLOSE_SHORT_ARRAY => \T_CLOSE_SHORT_ARRAY, ]; - if (\version_compare(Helper::getVersion(), '3.7.1', '<=')) { - $expected[\T_OPEN_SQUARE_BRACKET] = \T_OPEN_SQUARE_BRACKET; - $expected[\T_CLOSE_SQUARE_BRACKET] = \T_CLOSE_SQUARE_BRACKET; - } - $this->assertSame($expected, Collections::arrayTokensBC()); } } diff --git a/Tests/Tokens/Collections/ListOpenTokensBCTest.php b/Tests/Tokens/Collections/ListOpenTokensBCTest.php index 487d8942..ddbcc615 100644 --- a/Tests/Tokens/Collections/ListOpenTokensBCTest.php +++ b/Tests/Tokens/Collections/ListOpenTokensBCTest.php @@ -38,10 +38,6 @@ public function testListOpenTokensBC() \T_OPEN_SHORT_ARRAY => \T_OPEN_SHORT_ARRAY, ]; - if (\version_compare(Helper::getVersion(), '3.7.1', '<=')) { - $expected[\T_OPEN_SQUARE_BRACKET] = \T_OPEN_SQUARE_BRACKET; - } - $this->assertSame($expected, Collections::listOpenTokensBC()); } } diff --git a/Tests/Tokens/Collections/ListTokensBCTest.php b/Tests/Tokens/Collections/ListTokensBCTest.php index fd94860b..d7a2eff8 100644 --- a/Tests/Tokens/Collections/ListTokensBCTest.php +++ b/Tests/Tokens/Collections/ListTokensBCTest.php @@ -39,11 +39,6 @@ public function testListTokensBC() \T_CLOSE_SHORT_ARRAY => \T_CLOSE_SHORT_ARRAY, ]; - if (\version_compare(Helper::getVersion(), '3.7.1', '<=')) { - $expected[\T_OPEN_SQUARE_BRACKET] = \T_OPEN_SQUARE_BRACKET; - $expected[\T_CLOSE_SQUARE_BRACKET] = \T_CLOSE_SQUARE_BRACKET; - } - $this->assertSame($expected, Collections::listTokensBC()); } } diff --git a/Tests/Tokens/Collections/ParameterPassingTokensTest.php b/Tests/Tokens/Collections/ParameterPassingTokensTest.php index 9638edd6..e457f90d 100644 --- a/Tests/Tokens/Collections/ParameterPassingTokensTest.php +++ b/Tests/Tokens/Collections/ParameterPassingTokensTest.php @@ -49,10 +49,6 @@ public function testParameterPassingTokens() \T_OPEN_SHORT_ARRAY => \T_OPEN_SHORT_ARRAY, ]; - if (\version_compare(Helper::getVersion(), '3.7.1', '<=')) { - $expected[\T_OPEN_SQUARE_BRACKET] = \T_OPEN_SQUARE_BRACKET; - } - $this->assertSame($expected, Collections::parameterPassingTokens()); } } diff --git a/Tests/Tokens/Collections/ShortArrayListOpenTokensBCTest.php b/Tests/Tokens/Collections/ShortArrayListOpenTokensBCTest.php index 81526b2e..d85bf8c1 100644 --- a/Tests/Tokens/Collections/ShortArrayListOpenTokensBCTest.php +++ b/Tests/Tokens/Collections/ShortArrayListOpenTokensBCTest.php @@ -37,10 +37,6 @@ public function testShortArrayListOpenTokensBC() \T_OPEN_SHORT_ARRAY => \T_OPEN_SHORT_ARRAY, ]; - if (\version_compare(Helper::getVersion(), '3.7.1', '<=')) { - $expected[\T_OPEN_SQUARE_BRACKET] = \T_OPEN_SQUARE_BRACKET; - } - $this->assertSame($expected, Collections::shortArrayListOpenTokensBC()); } } diff --git a/Tests/Tokens/Collections/ShortArrayTokensBCTest.php b/Tests/Tokens/Collections/ShortArrayTokensBCTest.php index 4c023e26..0d8d75bd 100644 --- a/Tests/Tokens/Collections/ShortArrayTokensBCTest.php +++ b/Tests/Tokens/Collections/ShortArrayTokensBCTest.php @@ -38,11 +38,6 @@ public function testShortArrayTokensBC() \T_CLOSE_SHORT_ARRAY => \T_CLOSE_SHORT_ARRAY, ]; - if (\version_compare(Helper::getVersion(), '3.7.1', '<=')) { - $expected[\T_OPEN_SQUARE_BRACKET] = \T_OPEN_SQUARE_BRACKET; - $expected[\T_CLOSE_SQUARE_BRACKET] = \T_CLOSE_SQUARE_BRACKET; - } - $this->assertSame($expected, Collections::shortArrayTokensBC()); } } diff --git a/Tests/Tokens/Collections/ShortListTokensBCTest.php b/Tests/Tokens/Collections/ShortListTokensBCTest.php index e2775f0a..5b403d4a 100644 --- a/Tests/Tokens/Collections/ShortListTokensBCTest.php +++ b/Tests/Tokens/Collections/ShortListTokensBCTest.php @@ -38,11 +38,6 @@ public function testShortListTokensBC() \T_CLOSE_SHORT_ARRAY => \T_CLOSE_SHORT_ARRAY, ]; - if (\version_compare(Helper::getVersion(), '3.7.1', '<=')) { - $expected[\T_OPEN_SQUARE_BRACKET] = \T_OPEN_SQUARE_BRACKET; - $expected[\T_CLOSE_SQUARE_BRACKET] = \T_CLOSE_SQUARE_BRACKET; - } - $this->assertSame($expected, Collections::shortListTokensBC()); } }