Browse Source

DX: officially enable 8.2 support (#6825)

Dariusz Rumiński 2 years ago
parent
commit
3607c6b473

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

@@ -35,32 +35,35 @@ jobs:
 
           - operating-system: 'ubuntu-20.04'
             php-version: '8.1'
+
+          - operating-system: 'ubuntu-20.04'
+            php-version: '8.2'
             job-description: 'with migration rules'
             migration-rules: 'yes' # should be checked on the highest supported PHP version
 
           - operating-system: 'ubuntu-20.04'
-            php-version: '8.1'
+            php-version: '8.2'
             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-version: '8.2'
             job-description: 'with deployment'
             execute-deployment: 'yes'
 
           - operating-system: 'ubuntu-20.04'
-            php-version: '8.2'
+            php-version: '8.3'
             PHP_CS_FIXER_IGNORE_ENV: 1
             composer-flags: '--ignore-platform-req=PHP'
 
           - operating-system: 'windows-latest'
-            php-version: '8.1'
+            php-version: '8.2'
             job-description: 'on Windows'
             FAST_LINT_TEST_CASES: 1
 
           - operating-system: 'macos-latest'
-            php-version: '8.1'
+            php-version: '8.2'
             job-description: 'on macOS'
 
     name: PHP ${{ matrix.php-version }} ${{ matrix.job-description }}

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

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

+ 1 - 0
README.md

@@ -24,6 +24,7 @@ projects. This tool does not only detect them, but also fixes them for you.
 * PHP 7.4
 * PHP 8.0 (except PHP 8.0.0 due to [bug in PHP tokenizer](https://bugs.php.net/bug.php?id=80462))
 * PHP 8.1
+* PHP 8.2
 
 > **Note**
 > Each new PHP version requires a huge effort to support the new syntax.

+ 2 - 2
php-cs-fixer

@@ -28,8 +28,8 @@ set_error_handler(static function ($severity, $message, $file, $line) {
         exit(1);
     }
 
-    if (\PHP_VERSION_ID < 70400 || \PHP_VERSION_ID >= 80200) {
-        fwrite(STDERR, "PHP needs to be a minimum version of PHP 7.4.0 and maximum version of PHP 8.1.*.\n");
+    if (\PHP_VERSION_ID < 70400 || \PHP_VERSION_ID >= 80300) {
+        fwrite(STDERR, "PHP needs to be a minimum version of PHP 7.4.0 and maximum version of PHP 8.2.*.\n");
         fwrite(STDERR, 'Current PHP version: '.PHP_VERSION.".\n");
 
         if (getenv('PHP_CS_FIXER_IGNORE_ENV')) {

+ 1 - 1
tests/AutoReview/CiConfigurationTest.php

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

+ 1 - 1
tests/AutoReview/ReadmeTest.php

@@ -44,7 +44,7 @@ final class ReadmeTest extends TestCase
 
         static::assertEqualsCanonicalizing([
             '    if (\PHP_VERSION_ID === 80000) {'."\n",
-            '    if (\PHP_VERSION_ID < 70400 || \PHP_VERSION_ID >= 80200) {'."\n",
+            '    if (\PHP_VERSION_ID < 70400 || \PHP_VERSION_ID >= 80300) {'."\n",
         ], $phpVersionIdLines, 'Seems supported PHP versions changed in "./php-cs-fixer" - edit the README.md (and this test file) to match them!');
     }
 }

+ 1 - 1
tests/Smoke/CiIntegrationTest.php

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