Browse Source

PHP8.1 support

SpacePossum 3 years ago
parent
commit
c86c22ae60

+ 4 - 5
.github/workflows/ci.yml

@@ -37,19 +37,18 @@ jobs:
 
           - operating-system: 'ubuntu-20.04'
             php-version: '8.0'
+
+          - operating-system: 'ubuntu-20.04'
+            php-version: '8.1'
             job-description: 'with migration rules'
             execute-migration-rules: 'yes' # should be checked on highest supported PHP version
 
           - operating-system: 'ubuntu-20.04'
-            php-version: '8.0'
+            php-version: '8.1'
             job-description: 'with calculating code coverage'
             calculate-code-coverage: 'yes'
             phpunit-flags: '--testsuite coverage --exclude-group covers-nothing --coverage-clover build/logs/clover.xml'
 
-          - operating-system: 'ubuntu-20.04'
-            php-version: '8.1'
-            PHP_CS_FIXER_IGNORE_ENV: 1
-
           - operating-system: 'windows-latest'
             php-version: '7.4'
             job-description: 'on Windows'

+ 3 - 3
.php-cs-fixer.php-highest.php

@@ -10,8 +10,8 @@
  * with this source code in the file LICENSE.
  */
 
-if (PHP_VERSION_ID <= 80001 || PHP_VERSION_ID >= 80100) {
-    fwrite(STDERR, "PHP CS Fixer's config for PHP-HIGHEST can be executed only on highest supported PHP version - 8.0.*.\n");
+if (PHP_VERSION_ID < 80100 || PHP_VERSION_ID >= 80200) {
+    fwrite(STDERR, "PHP CS Fixer's config for PHP-HIGHEST can be executed only on highest supported PHP version - 8.1.*.\n");
     fwrite(STDERR, "Running it on lower PHP version would prevent calling migration rules.\n");
     exit(1);
 }
@@ -19,7 +19,7 @@ if (PHP_VERSION_ID <= 80001 || PHP_VERSION_ID >= 80100) {
 $config = require '.php-cs-fixer.dist.php';
 
 $config->setRules(array_merge($config->getRules(), [
-    '@PHP80Migration' => true,
+    '@PHP81Migration' => true,
     '@PHP80Migration:risky' => true,
     'heredoc_indentation' => false,
 ]));

+ 2 - 2
php-cs-fixer

@@ -40,9 +40,9 @@ set_error_handler(static function ($severity, $message, $file, $line) {
         exit(1);
     } elseif (
         \PHP_VERSION_ID < 70205
-        || \PHP_VERSION_ID >= 80100
+        || \PHP_VERSION_ID >= 80200
     ) {
-        fwrite(STDERR, "PHP needs to be a minimum version of PHP 7.2.5 and maximum version of PHP 8.0.*.\n");
+        fwrite(STDERR, "PHP needs to be a minimum version of PHP 7.2.5 and maximum version of PHP 8.1.*.\n");
         fwrite(STDERR, 'Current PHP version: '.PHP_VERSION.".\n");
 
         if (getenv('PHP_CS_FIXER_IGNORE_ENV')) {

+ 1 - 1
tests/AutoReview/CiConfigurationTest.php

@@ -101,7 +101,7 @@ final class CiConfigurationTest extends TestCase
 
     private static function assertUpcomingPhpVersionIsCoveredByCiJob(string $lastSupportedVersion, array $ciVersions): void
     {
-        if ('8.0' === $lastSupportedVersion) {
+        if ('8.1' === $lastSupportedVersion) {
             return; // no further releases available yet
         }
 

+ 1 - 1
tests/Smoke/CiIntegrationTest.php

@@ -148,7 +148,7 @@ final class CiIntegrationTest extends AbstractSmokeTest
 You may find an UPGRADE guide at https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/v4.0.0/UPGRADE-v4.md .
 ';
 
-        $optionalIncompatibilityWarning = 'PHP needs to be a minimum version of PHP 7.2.5 and maximum version of PHP 8.0.*.
+        $optionalIncompatibilityWarning = 'PHP needs to be a minimum version of PHP 7.2.5 and maximum version of PHP 8.1.*.
 Current PHP version: '.PHP_VERSION.'.
 Ignoring environment requirements because `PHP_CS_FIXER_IGNORE_ENV` is set. Execution may be unstable.
 ';