Skip to content

Commit 09bae71

Browse files
committed
Composer: raise the minimum supported PHPCS version to 3.8.0
... to prevent end-users from running into trouble with the name change. The files in the Composer `vendor/bin` will only be replaced when the `replace...` directive is found and that is only available in the 3.8.0 tag. When the files in the Composer `vendor/bin` are not replaced, they will continue to point to the `vendor/squizlabs/php_codesniffer` directory which will no longer exist, leading to fatal "File not found" errors for end-users trying to run PHPCS/PHPCBF. Includes updating references to the PHPCS version whenever relevant throughout the codebase.
1 parent 732219c commit 09bae71

File tree

7 files changed

+20
-19
lines changed

7 files changed

+20
-19
lines changed

PHPCSUtils/BackCompat/BCFile.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ public static function getMethodParameters(File $phpcsFile, $stackPtr)
498498
*
499499
* Changelog for the PHPCS native function:
500500
* - Introduced in PHPCS 0.0.5.
501-
* - The upstream method has received no significant updates since PHPCS 3.7.1.
501+
* - The upstream method has received no significant updates since PHPCS 3.8.0.
502502
*
503503
* @see \PHP_CodeSniffer\Files\File::getMethodProperties() Original source.
504504
* @see \PHPCSUtils\Utils\FunctionDeclarations::getProperties() PHPCSUtils native improved version.
@@ -543,7 +543,7 @@ public static function getMethodProperties(File $phpcsFile, $stackPtr)
543543
*
544544
* Changelog for the PHPCS native function:
545545
* - Introduced in PHPCS 0.0.5.
546-
* - The upstream method has received no significant updates since PHPCS 3.7.1.
546+
* - The upstream method has received no significant updates since PHPCS 3.8.0.
547547
*
548548
* @see \PHP_CodeSniffer\Files\File::getMemberProperties() Original source.
549549
* @see \PHPCSUtils\Utils\Variables::getMemberProperties() PHPCSUtils native improved version.
@@ -653,7 +653,7 @@ public static function getClassProperties(File $phpcsFile, $stackPtr)
653653
*
654654
* Changelog for the PHPCS native function:
655655
* - Introduced in PHPCS 0.0.5.
656-
* - The upstream method has received no significant updates since PHPCS 3.7.1.
656+
* - The upstream method has received no significant updates since PHPCS 3.8.0.
657657
*
658658
* @see \PHP_CodeSniffer\Files\File::isReference() Original source.
659659
* @see \PHPCSUtils\Utils\Operators::isReference() PHPCSUtils native improved version.
@@ -679,7 +679,7 @@ public static function isReference(File $phpcsFile, $stackPtr)
679679
*
680680
* Changelog for the PHPCS native function:
681681
* - Introduced in PHPCS 0.0.5.
682-
* - The upstream method has received no significant updates since PHPCS 3.7.1.
682+
* - The upstream method has received no significant updates since PHPCS 3.8.0.
683683
*
684684
* @see \PHP_CodeSniffer\Files\File::getTokensAsString() Original source.
685685
* @see \PHPCSUtils\Utils\GetTokensAsString Related set of functions.
@@ -708,7 +708,7 @@ public static function getTokensAsString(File $phpcsFile, $start, $length, $orig
708708
*
709709
* Changelog for the PHPCS native function:
710710
* - Introduced in PHPCS 2.1.0.
711-
* - The upstream method has received no significant updates since PHPCS 3.7.1.
711+
* - The upstream method has received no significant updates since PHPCS 3.8.0.
712712
*
713713
* @see \PHP_CodeSniffer\Files\File::findStartOfStatement() Original source.
714714
*
@@ -732,7 +732,7 @@ public static function findStartOfStatement(File $phpcsFile, $start, $ignore = n
732732
*
733733
* Changelog for the PHPCS native function:
734734
* - Introduced in PHPCS 2.1.0.
735-
* - The upstream method has received no significant updates since PHPCS 3.7.1.
735+
* - The upstream method has received no significant updates since PHPCS 3.8.0.
736736
*
737737
* @see \PHP_CodeSniffer\Files\File::findEndOfStatement() Original source.
738738
*
@@ -756,7 +756,7 @@ public static function findEndOfStatement(File $phpcsFile, $start, $ignore = nul
756756
*
757757
* Changelog for the PHPCS native function:
758758
* - Introduced in PHPCS 0.0.5.
759-
* - The upstream method has received no significant updates since PHPCS 3.7.1.
759+
* - The upstream method has received no significant updates since PHPCS 3.8.0.
760760
*
761761
* @see \PHP_CodeSniffer\Files\File::hasCondition() Original source.
762762
* @see \PHPCSUtils\Utils\Conditions::hasCondition() PHPCSUtils native alternative.
@@ -781,7 +781,7 @@ public static function hasCondition(File $phpcsFile, $stackPtr, $types)
781781
*
782782
* Changelog for the PHPCS native function:
783783
* - Introduced in PHPCS 1.3.0.
784-
* - The upstream method has received no significant updates since PHPCS 3.7.1.
784+
* - The upstream method has received no significant updates since PHPCS 3.8.0.
785785
*
786786
* @see \PHP_CodeSniffer\Files\File::getCondition() Original source.
787787
* @see \PHPCSUtils\Utils\Conditions::getCondition() More versatile alternative.
@@ -812,7 +812,7 @@ public static function getCondition(File $phpcsFile, $stackPtr, $type, $first =
812812
*
813813
* Changelog for the PHPCS native function:
814814
* - Introduced in PHPCS 1.2.0.
815-
* - The upstream method has received no significant updates since PHPCS 3.7.1.
815+
* - The upstream method has received no significant updates since PHPCS 3.8.0.
816816
*
817817
* @see \PHP_CodeSniffer\Files\File::findExtendedClassName() Original source.
818818
* @see \PHPCSUtils\Utils\ObjectDeclarations::findExtendedClassName() PHPCSUtils native improved version.
@@ -837,7 +837,7 @@ public static function findExtendedClassName(File $phpcsFile, $stackPtr)
837837
*
838838
* Changelog for the PHPCS native function:
839839
* - Introduced in PHPCS 2.7.0.
840-
* - The upstream method has received no significant updates since PHPCS 3.7.1.
840+
* - The upstream method has received no significant updates since PHPCS 3.8.0.
841841
*
842842
* @see \PHP_CodeSniffer\Files\File::findImplementedInterfaceNames() Original source.
843843
* @see \PHPCSUtils\Utils\ObjectDeclarations::findImplementedInterfaceNames() PHPCSUtils native improved version.

PHPCSUtils/BackCompat/BCTokens.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ final class BCTokens
7474

7575
/**
7676
* Handle calls to (undeclared) methods for token arrays which haven't received any
77-
* changes since PHPCS 3.7.1.
77+
* changes since PHPCS 3.8.0.
7878
*
7979
* @since 1.0.0
8080
*

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Whether you need to split an `array` into the individual items, are trying to de
4646

4747
Includes improved versions of the PHPCS native utility functions and plenty of new utility functions.
4848

49-
These functions are compatible with PHPCS 3.7.1 up to PHPCS `master`.
49+
These functions are compatible with PHPCS 3.8.0 up to PHPCS `master`.
5050

5151
### A collection of static properties and methods for often-used token groups
5252

@@ -66,7 +66,7 @@ Supports PHPUnit 4.x up to 9.x.
6666

6767
Normally to use the latest version of PHP_CodeSniffer native utility functions, you would have to raise the minimum requirements of your external PHPCS standard.
6868

69-
Now you won't have to anymore. This package allows you to use the latest version of those utility functions in all PHP_CodeSniffer versions from PHPCS 3.7.1 and up.
69+
Now you won't have to anymore. This package allows you to use the latest version of those utility functions in all PHP_CodeSniffer versions from PHPCS 3.8.0 and up.
7070

7171
### Fully documented
7272

@@ -78,7 +78,7 @@ To see detailed information about all the available abstract sniffs, utility fun
7878
## Minimum Requirements
7979

8080
* PHP 5.4 or higher.
81-
* [PHP_CodeSniffer] 3.7.1+.
81+
* [PHP_CodeSniffer] 3.8.0+.
8282
* Recommended PHP extensions for optimal functionality:
8383
- PCRE with Unicode support (normally enabled by default)
8484

Tests/BackCompat/Helper/GetVersionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ final class GetVersionTest extends TestCase
3232
*
3333
* @var string
3434
*/
35-
const DEVMASTER = '3.7.2';
35+
const DEVMASTER = '3.8.0';
3636

3737
/**
3838
* Test the method.
@@ -49,7 +49,7 @@ public function testGetVersion()
4949
}
5050

5151
if ($expected === 'lowest') {
52-
$expected = '3.7.1';
52+
$expected = '3.8.0';
5353
}
5454

5555
$result = Helper::getVersion();

Tests/Tokens/TokenHelper/TokenExistsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function testTokenExists($name, $expected)
5858
* {@internal This dataprovider does not currently contain any tests for
5959
* PHP native tokens which may not exist (depending on the PHPCS version).
6060
* These tests are not relevant at this time with the current minimum
61-
* PHPCS version of 3.7.1, but this may change again in the future.}
61+
* PHPCS version, but this may change again in the future.}
6262
*
6363
* @return array
6464
*/

Tests/Utils/Arrays/GetDoubleArrowPtrTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ public static function dataGetDoubleArrowPtr()
210210
'expected' => 8,
211211
],
212212
// Test specifically for PHPCS 3.5.3 and 3.5.4 in which all "fn" tokens were tokenized as T_FN.
213-
// While PHPCS < 3.7.1 is no longer supported, the test remains to safeguard against tokenizer regressions.
213+
// While these PHPCS versions are no longer supported, the test remains to safeguard against
214+
// tokenizer regressions.
214215
'test-arrow-access-to-property-named-fn-as-key-phpcs-3.5.3-3.5.4' => [
215216
'testMarker' => '/* testKeyPropertyAccessFnPHPCS353-354 */',
216217
'expected' => 12,

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
},
2525
"require" : {
2626
"php" : ">=5.4",
27-
"squizlabs/php_codesniffer" : "^3.7.1 || 4.0.x-dev@dev",
27+
"squizlabs/php_codesniffer" : "^3.8.0 || 4.0.x-dev@dev",
2828
"dealerdirect/phpcodesniffer-composer-installer" : "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0"
2929
},
3030
"require-dev" : {

0 commit comments

Comments
 (0)