Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:

include:
- php: '7.4'
phpcompat: 'dev-develop as 9.99.99'
phpcompat: 'dev-develop as 10.99.99'
experimental: true

name: "Test: PHP ${{ matrix.php }} - PHPCompat ${{ matrix.phpcompat }}"
Expand Down Expand Up @@ -133,49 +133,49 @@ jobs:
# Make sure that known polyfills don't trigger any errors.
- name: Test the rulesets
run: |
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP54Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP54 --runtime-set testVersion 5.3-
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP55Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP55 --runtime-set testVersion 5.3-
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP56Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP56 --runtime-set testVersion 5.3-
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP70Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP70 --runtime-set testVersion 5.3-
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP71Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP71 --runtime-set testVersion 5.3-
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP72Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP72 --runtime-set testVersion 5.3-
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP73Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP73 --runtime-set testVersion 5.3-
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP74Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP74 --runtime-set testVersion 5.3-
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP54Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP54 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.3-
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP55Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP55 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.3-
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP56Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP56 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.3-
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP70Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP70 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.3-
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP71Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP71 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.3-
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP72Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP72 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.3-
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP73Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP73 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.3-
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP74Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP74 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.3-

- name: Test the PHP 8.0 ruleset
# The PHP 8.0 polyfill has a minimum PHP requirement of PHP 7.1.
if: ${{ matrix.php != '5.4' }}
run: |
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP80Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP80 --runtime-set testVersion 7.1-
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP80Test.php --exclude=PHPCompatibility.Upgrade.LowPHP --standard=PHPCompatibilitySymfonyPolyfillPHP80 --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.
# The polyfills for PHP 7.2 has been decoupled from the monorepo at version 1.30.
# The polyfills for PHP 7.2 have been decoupled from the monorepo at version 1.30.
# These are no longer updated.
- name: Test running against the polyfills - polyfills 5.4-7.1
run: |
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php54/ --standard=PHPCompatibilitySymfonyPolyfillPHP54 --runtime-set testVersion 5.3-
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php55/ --standard=PHPCompatibilitySymfonyPolyfillPHP55 --runtime-set testVersion 5.3-
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php56/ ./vendor/symfony/polyfill-util/ --standard=PHPCompatibilitySymfonyPolyfillPHP56 --runtime-set testVersion 5.3- --ignore=*/polyfill-util/TestListener*
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php70/ --standard=PHPCompatibilitySymfonyPolyfillPHP70 --runtime-set testVersion 5.3-
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php71/ --standard=PHPCompatibilitySymfonyPolyfillPHP71 --runtime-set testVersion 5.3-
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php54/ --standard=PHPCompatibilitySymfonyPolyfillPHP54 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.3-
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php55/ --standard=PHPCompatibilitySymfonyPolyfillPHP55 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.3-
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php56/ ./vendor/symfony/polyfill-util/ --standard=PHPCompatibilitySymfonyPolyfillPHP56 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.3- --ignore=*/polyfill-util/TestListener*
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php70/ --standard=PHPCompatibilitySymfonyPolyfillPHP70 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.3-
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php71/ --standard=PHPCompatibilitySymfonyPolyfillPHP71 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.3-

# The polyfills for PHP 7.2 and higher are compatible with PHP 5.3+ at version 1.19.
- name: "Test running against the polyfills - polyfills 7.2- (v1.19)"
if: ${{ matrix.php == '5.4' }}
run: |
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php72/ --standard=PHPCompatibilitySymfonyPolyfillPHP72 --runtime-set testVersion 5.3-
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php73/ --standard=PHPCompatibilitySymfonyPolyfillPHP73 --runtime-set testVersion 5.3-
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php74/ --standard=PHPCompatibilitySymfonyPolyfillPHP74 --runtime-set testVersion 5.3-
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php72/ --standard=PHPCompatibilitySymfonyPolyfillPHP72 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.3-
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php73/ --standard=PHPCompatibilitySymfonyPolyfillPHP73 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.3-
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php74/ --standard=PHPCompatibilitySymfonyPolyfillPHP74 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.3-

# The polyfills for PHP 7.2 and higher are compatible with PHP 7.1+ at version 1.30.
- name: "Test running against the polyfills - polyfills 7.2- (v1.30)"
if: ${{ matrix.php == '7.1' }}
run: |
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php72/ --standard=PHPCompatibilitySymfonyPolyfillPHP72 --runtime-set testVersion 7.1-
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php73/ --standard=PHPCompatibilitySymfonyPolyfillPHP73 --runtime-set testVersion 7.1-
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php74/ --standard=PHPCompatibilitySymfonyPolyfillPHP74 --runtime-set testVersion 7.1-
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php80/ --standard=PHPCompatibilitySymfonyPolyfillPHP80 --runtime-set testVersion 7.1-
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php72/ --standard=PHPCompatibilitySymfonyPolyfillPHP72 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 7.1-
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php73/ --standard=PHPCompatibilitySymfonyPolyfillPHP73 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 7.1-
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php74/ --standard=PHPCompatibilitySymfonyPolyfillPHP74 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 7.1-
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php80/ --standard=PHPCompatibilitySymfonyPolyfillPHP80 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 7.1-

# 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)"
Expand Down
7 changes: 7 additions & 0 deletions PHPCompatibilitySymfonyPolyfillPHP56/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,11 @@
<exclude name="PHPCompatibility.Constants.NewConstants.ldap_escape_dnFound"/>
</rule>

<!-- Prevent false positives being thrown when run over the code of polyfill-util itself. -->
<rule ref="PHPCompatibility.FunctionUse.NewFunctionParameters.strrchr_before_needleFound">
<!-- This looks to be a bug in the polyfill code, but probably pretty much an edge case
and if it hasn't been reported to Symfony so far, leave it be. -->
<exclude-pattern>/polyfill-util/BinaryNoFuncOverload\.php$</exclude-pattern>
</rule>

</ruleset>
2 changes: 2 additions & 0 deletions PHPCompatibilitySymfonyPolyfillPHP72/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.mb_ordFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.mb_chrFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.mb_scrubFound"/>
<exclude name="PHPCompatibility.FunctionUse.RemovedFunctions.utf8_encodeDeprecated"/>
<exclude name="PHPCompatibility.FunctionUse.RemovedFunctions.utf8_decodeDeprecated"/>
</rule>

<!-- Prevent false positives being thrown when run over the code of polyfill-php72 itself. -->
Expand Down
5 changes: 5 additions & 0 deletions PHPCompatibilitySymfonyPolyfillPHP80/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,9 @@
<exclude name="PHPCompatibility.Classes.NewClasses.valueerrorFound"/>
</rule>

<!-- Prevent false positives being thrown when run over the code of polyfill-util itself. -->
<rule ref="PHPCompatibility.Attributes.NewAttributes.PHPNativeAttributeFound">
<exclude-pattern>/polyfill-php80/Resources/stubs/Attribute\.php$</exclude-pattern>
</rule>

</ruleset>
Loading