Skip to content

Commit 241b491

Browse files
committed
feature #6152 PHP8.1 support (SpacePossum)
This PR was squashed before being merged into the master branch (closes #6152). Discussion ---------- PHP8.1 support @kubawerlos do you maybe have time to run the tests with the top X PHP projects to see if there is regression we overlooked? Commits ------- c86c22a PHP8.1 support
2 parents 3de1d1b + c86c22a commit 241b491

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,18 @@ jobs:
3737

3838
- operating-system: 'ubuntu-20.04'
3939
php-version: '8.0'
40+
41+
- operating-system: 'ubuntu-20.04'
42+
php-version: '8.1'
4043
job-description: 'with migration rules'
4144
execute-migration-rules: 'yes' # should be checked on highest supported PHP version
4245

4346
- operating-system: 'ubuntu-20.04'
44-
php-version: '8.0'
47+
php-version: '8.1'
4548
job-description: 'with calculating code coverage'
4649
calculate-code-coverage: 'yes'
4750
phpunit-flags: '--testsuite coverage --exclude-group covers-nothing --coverage-clover build/logs/clover.xml'
4851

49-
- operating-system: 'ubuntu-20.04'
50-
php-version: '8.1'
51-
PHP_CS_FIXER_IGNORE_ENV: 1
52-
5352
- operating-system: 'windows-latest'
5453
php-version: '7.4'
5554
job-description: 'on Windows'

.php-cs-fixer.php-highest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010
* with this source code in the file LICENSE.
1111
*/
1212

13-
if (PHP_VERSION_ID <= 80001 || PHP_VERSION_ID >= 80100) {
14-
fwrite(STDERR, "PHP CS Fixer's config for PHP-HIGHEST can be executed only on highest supported PHP version - 8.0.*.\n");
13+
if (PHP_VERSION_ID < 80100 || PHP_VERSION_ID >= 80200) {
14+
fwrite(STDERR, "PHP CS Fixer's config for PHP-HIGHEST can be executed only on highest supported PHP version - 8.1.*.\n");
1515
fwrite(STDERR, "Running it on lower PHP version would prevent calling migration rules.\n");
1616
exit(1);
1717
}
1818

1919
$config = require '.php-cs-fixer.dist.php';
2020

2121
$config->setRules(array_merge($config->getRules(), [
22-
'@PHP80Migration' => true,
22+
'@PHP81Migration' => true,
2323
'@PHP80Migration:risky' => true,
2424
'heredoc_indentation' => false,
2525
]));

php-cs-fixer

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ set_error_handler(static function ($severity, $message, $file, $line) {
4040
exit(1);
4141
} elseif (
4242
\PHP_VERSION_ID < 70205
43-
|| \PHP_VERSION_ID >= 80100
43+
|| \PHP_VERSION_ID >= 80200
4444
) {
45-
fwrite(STDERR, "PHP needs to be a minimum version of PHP 7.2.5 and maximum version of PHP 8.0.*.\n");
45+
fwrite(STDERR, "PHP needs to be a minimum version of PHP 7.2.5 and maximum version of PHP 8.1.*.\n");
4646
fwrite(STDERR, 'Current PHP version: '.PHP_VERSION.".\n");
4747

4848
if (getenv('PHP_CS_FIXER_IGNORE_ENV')) {

tests/AutoReview/CiConfigurationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ private static function ensureTraversableContainsIdenticalIsAvailable(): void
101101

102102
private static function assertUpcomingPhpVersionIsCoveredByCiJob(string $lastSupportedVersion, array $ciVersions): void
103103
{
104-
if ('8.0' === $lastSupportedVersion) {
104+
if ('8.1' === $lastSupportedVersion) {
105105
return; // no further releases available yet
106106
}
107107

tests/Smoke/CiIntegrationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public function testIntegration(
148148
You may find an UPGRADE guide at https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/v4.0.0/UPGRADE-v4.md .
149149
';
150150

151-
$optionalIncompatibilityWarning = 'PHP needs to be a minimum version of PHP 7.2.5 and maximum version of PHP 8.0.*.
151+
$optionalIncompatibilityWarning = 'PHP needs to be a minimum version of PHP 7.2.5 and maximum version of PHP 8.1.*.
152152
Current PHP version: '.PHP_VERSION.'.
153153
Ignoring environment requirements because `PHP_CS_FIXER_IGNORE_ENV` is set. Execution may be unstable.
154154
';

0 commit comments

Comments
 (0)