diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 59f515f..3162db3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,6 +62,7 @@ jobs: diff -B ./PHPCompatibilitySymfonyPolyfillPHP80/ruleset.xml <(xmllint --format "./PHPCompatibilitySymfonyPolyfillPHP80/ruleset.xml") diff -B ./PHPCompatibilitySymfonyPolyfillPHP81/ruleset.xml <(xmllint --format "./PHPCompatibilitySymfonyPolyfillPHP81/ruleset.xml") diff -B ./PHPCompatibilitySymfonyPolyfillPHP82/ruleset.xml <(xmllint --format "./PHPCompatibilitySymfonyPolyfillPHP82/ruleset.xml") + diff -B ./PHPCompatibilitySymfonyPolyfillPHP83/ruleset.xml <(xmllint --format "./PHPCompatibilitySymfonyPolyfillPHP83/ruleset.xml") test: # Don't run the cron job on forks. @@ -110,13 +111,13 @@ jobs: # Remove the PHP 8.x polyfills on PHP < 7 as the minimum requirement is PHP 7.1 and the autoloading # of the polyfill bootstrap file via Composer would generate a parse error, blocking the DealerDirect plugin # from setting the installed_paths for PHPCS. - composer remove --dev symfony/polyfill-php80 symfony/polyfill-php81 symfony/polyfill-php82 --no-update --no-scripts --no-interaction + composer remove --dev symfony/polyfill-php80 symfony/polyfill-php81 symfony/polyfill-php82 symfony/polyfill-php83 --no-update --no-scripts --no-interaction composer require --no-update symfony/polyfill-php72:"1.19" symfony/polyfill-php73:"1.19" symfony/polyfill-php74:"1.19" --no-interaction - name: "Conditionally require specific versions of the polyfills (PHP 7.1)" if: ${{ matrix.php == '7.1' }} run: | - composer require --no-update symfony/polyfill-php73:"1.30" symfony/polyfill-php74:"1.30" symfony/polyfill-php80:"1.30" symfony/polyfill-php81:"1.30" symfony/polyfill-php82:"1.30" --no-interaction + composer require --no-update symfony/polyfill-php73:"1.30" symfony/polyfill-php74:"1.30" symfony/polyfill-php80:"1.30" symfony/polyfill-php81:"1.30" symfony/polyfill-php82:"1.30" symfony/polyfill-php83:"1.30" --no-interaction - name: Conditionally update PHPCompatibility to develop version if: ${{ matrix.phpcompat != 'stable' }} @@ -151,6 +152,7 @@ jobs: vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP80Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP80 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 7.1- vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP81Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP81 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 7.1- vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP82Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP82 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 7.1- + vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP83Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP83 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 7.1- # Check that the rulesets don't throw unnecessary errors for the compat libraries themselves. # Note: the polyfills for PHP 5.4 - 7.1 have been decoupled from the monorepo at version 1.19. @@ -182,6 +184,8 @@ jobs: vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php80/ --standard=PHPCompatibilitySymfonyPolyfillPHP80 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 7.1- vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php81/ --standard=PHPCompatibilitySymfonyPolyfillPHP81 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 7.1- vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php82/ --standard=PHPCompatibilitySymfonyPolyfillPHP82 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 7.1- + # The PHP 8.3 polyfills at version 1.30 are not tested against PHP 7.1 as they are not in actual fact + # compatible with PHP 7.1. This was correctly detected by PHPCompatibility and would cause this test to fail. # The polyfills for PHP 7.3 and higher are compatible with PHP 7.2+ at the current version. - name: "Test running against the polyfills - polyfills 7.3- (current)" @@ -192,3 +196,4 @@ jobs: vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php80/ --standard=PHPCompatibilitySymfonyPolyfillPHP80 --runtime-set testVersion 7.2- vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php81/ --standard=PHPCompatibilitySymfonyPolyfillPHP81 --runtime-set testVersion 7.2- vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php82/ --standard=PHPCompatibilitySymfonyPolyfillPHP82 --runtime-set testVersion 7.2- + vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php83/ --standard=PHPCompatibilitySymfonyPolyfillPHP83 --runtime-set testVersion 7.2- diff --git a/PHPCompatibilitySymfonyPolyfillPHP83/ruleset.xml b/PHPCompatibilitySymfonyPolyfillPHP83/ruleset.xml new file mode 100644 index 0000000..3562500 --- /dev/null +++ b/PHPCompatibilitySymfonyPolyfillPHP83/ruleset.xml @@ -0,0 +1,98 @@ + + + + PHPCompatibility ruleset for PHP_CodeSniffer which accounts for polyfills provided by the Symfony PHP 8.3 library. + + + + + + + + + + + + + + + + + + + + + + + + + + + + /polyfill-php83/Resources/stubs/Override\.php$ + + + /polyfill-php83/Resources/stubs/Override\.php$ + + + + /polyfill-php83/bootstrap\.php$ + + + /polyfill-php83/bootstrap\.php$ + + + /polyfill-php83/bootstrap\.php$ + /polyfill-php83/bootstrap81\.php$ + + + /polyfill-php83/bootstrap\.php$ + /polyfill-php83/bootstrap81\.php$ + + + /polyfill-php83/bootstrap\.php$ + /polyfill-php83/bootstrap81\.php$ + + + + + /polyfill-php83/bootstrap81\.php$ + + + /polyfill-php83/bootstrap81\.php$ + + + /polyfill-php83/bootstrap81\.php$ + + + /polyfill-php83/bootstrap81\.php$ + + + /polyfill-php83/bootstrap81\.php$ + + + /polyfill-php83/bootstrap81\.php$ + + + + + /polyfill-php83/Php83\.php$ + + + + + /polyfill-php83/bootstrap\.php$ + + + diff --git a/README.md b/README.md index b07dc17..90340dc 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ These rulesets prevent false positives from the [PHPCompatibility standard][PHPC | [`polyfill-php80`] | `PHPCompatibilitySymfonyPolyfillPHP80` | | | [`polyfill-php81`] | `PHPCompatibilitySymfonyPolyfillPHP81` | | | [`polyfill-php82`] | `PHPCompatibilitySymfonyPolyfillPHP82` | | +| [`polyfill-php83`] | `PHPCompatibilitySymfonyPolyfillPHP83` | | > [!NOTE] > About "Includes": @@ -101,6 +102,7 @@ vendor/bin/phpcs -p . --standard=PHPCompatibilitySymfonyPolyfillPHP74 vendor/bin/phpcs -p . --standard=PHPCompatibilitySymfonyPolyfillPHP80 vendor/bin/phpcs -p . --standard=PHPCompatibilitySymfonyPolyfillPHP81 vendor/bin/phpcs -p . --standard=PHPCompatibilitySymfonyPolyfillPHP82 +vendor/bin/phpcs -p . --standard=PHPCompatibilitySymfonyPolyfillPHP83 # You can also combine the standards if your project uses several: vendor/bin/phpcs -p . --standard=PHPCompatibilitySymfonyPolyfillPHP55,PHPCompatibilitySymfonyPolyfillPHP70,PHPCompatibilitySymfonyPolyfillPHP73 @@ -156,3 +158,4 @@ All code within the PHPCompatibility organisation is released under the GNU Less [`polyfill-php80`]: https://github.com/symfony/polyfill-php80 [`polyfill-php81`]: https://github.com/symfony/polyfill-php81 [`polyfill-php82`]: https://github.com/symfony/polyfill-php82 +[`polyfill-php83`]: https://github.com/symfony/polyfill-php83 diff --git a/Test/SymfonyPolyfillPHP83Test.php b/Test/SymfonyPolyfillPHP83Test.php new file mode 100644 index 0000000..a071114 --- /dev/null +++ b/Test/SymfonyPolyfillPHP83Test.php @@ -0,0 +1,26 @@ +