Skip to content

Commit 69d23c0

Browse files
authored
Merge pull request #65 from PHPCompatibility/feature/update-for-phpcompatibility-10.0.0-alpha1
Version 2.0.0-alpha1 / Update for PHPCompatibility 10.0.0-alpha1
2 parents e4062dd + a4bf54b commit 69d23c0

File tree

7 files changed

+124
-93
lines changed

7 files changed

+124
-93
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383

8484
include:
8585
- php: '7.4'
86-
phpcompat: 'dev-develop as 9.99.99'
86+
phpcompat: 'dev-develop as 10.99.99'
8787
experimental: true
8888

8989
name: "Test: PHP ${{ matrix.php }} - PHPCompat ${{ matrix.phpcompat }}"
@@ -133,49 +133,49 @@ jobs:
133133
# Make sure that known polyfills don't trigger any errors.
134134
- name: Test the rulesets
135135
run: |
136-
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP54Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP54 --runtime-set testVersion 5.3-
137-
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP55Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP55 --runtime-set testVersion 5.3-
138-
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP56Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP56 --runtime-set testVersion 5.3-
139-
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP70Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP70 --runtime-set testVersion 5.3-
140-
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP71Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP71 --runtime-set testVersion 5.3-
141-
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP72Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP72 --runtime-set testVersion 5.3-
142-
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP73Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP73 --runtime-set testVersion 5.3-
143-
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP74Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP74 --runtime-set testVersion 5.3-
136+
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP54Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP54 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.3-
137+
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP55Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP55 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.3-
138+
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP56Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP56 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.3-
139+
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP70Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP70 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.3-
140+
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP71Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP71 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.3-
141+
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP72Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP72 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.3-
142+
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP73Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP73 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.3-
143+
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP74Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP74 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.3-
144144
145145
- name: Test the PHP 8.0 ruleset
146146
# The PHP 8.0 polyfill has a minimum PHP requirement of PHP 7.1.
147147
if: ${{ matrix.php != '5.4' }}
148148
run: |
149-
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP80Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP80 --runtime-set testVersion 7.1-
149+
vendor/bin/phpcs -ps ./Test/SymfonyPolyfillPHP80Test.php --exclude=PHPCompatibility.Upgrade.LowPHP --standard=PHPCompatibilitySymfonyPolyfillPHP80 --runtime-set testVersion 7.1-
150150
151151
# Check that the rulesets don't throw unnecessary errors for the compat libraries themselves.
152152
# Note: the polyfills for PHP 5.4 - 7.1 have been decoupled from the monorepo at version 1.19.
153-
# The polyfills for PHP 7.2 has been decoupled from the monorepo at version 1.30.
153+
# The polyfills for PHP 7.2 have been decoupled from the monorepo at version 1.30.
154154
# These are no longer updated.
155155
- name: Test running against the polyfills - polyfills 5.4-7.1
156156
run: |
157-
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php54/ --standard=PHPCompatibilitySymfonyPolyfillPHP54 --runtime-set testVersion 5.3-
158-
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php55/ --standard=PHPCompatibilitySymfonyPolyfillPHP55 --runtime-set testVersion 5.3-
159-
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php56/ ./vendor/symfony/polyfill-util/ --standard=PHPCompatibilitySymfonyPolyfillPHP56 --runtime-set testVersion 5.3- --ignore=*/polyfill-util/TestListener*
160-
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php70/ --standard=PHPCompatibilitySymfonyPolyfillPHP70 --runtime-set testVersion 5.3-
161-
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php71/ --standard=PHPCompatibilitySymfonyPolyfillPHP71 --runtime-set testVersion 5.3-
157+
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php54/ --standard=PHPCompatibilitySymfonyPolyfillPHP54 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.3-
158+
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php55/ --standard=PHPCompatibilitySymfonyPolyfillPHP55 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.3-
159+
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*
160+
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php70/ --standard=PHPCompatibilitySymfonyPolyfillPHP70 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.3-
161+
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php71/ --standard=PHPCompatibilitySymfonyPolyfillPHP71 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.3-
162162
163163
# The polyfills for PHP 7.2 and higher are compatible with PHP 5.3+ at version 1.19.
164164
- name: "Test running against the polyfills - polyfills 7.2- (v1.19)"
165165
if: ${{ matrix.php == '5.4' }}
166166
run: |
167-
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php72/ --standard=PHPCompatibilitySymfonyPolyfillPHP72 --runtime-set testVersion 5.3-
168-
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php73/ --standard=PHPCompatibilitySymfonyPolyfillPHP73 --runtime-set testVersion 5.3-
169-
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php74/ --standard=PHPCompatibilitySymfonyPolyfillPHP74 --runtime-set testVersion 5.3-
167+
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php72/ --standard=PHPCompatibilitySymfonyPolyfillPHP72 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.3-
168+
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php73/ --standard=PHPCompatibilitySymfonyPolyfillPHP73 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.3-
169+
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php74/ --standard=PHPCompatibilitySymfonyPolyfillPHP74 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.3-
170170
171171
# The polyfills for PHP 7.2 and higher are compatible with PHP 7.1+ at version 1.30.
172172
- name: "Test running against the polyfills - polyfills 7.2- (v1.30)"
173173
if: ${{ matrix.php == '7.1' }}
174174
run: |
175-
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php72/ --standard=PHPCompatibilitySymfonyPolyfillPHP72 --runtime-set testVersion 7.1-
176-
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php73/ --standard=PHPCompatibilitySymfonyPolyfillPHP73 --runtime-set testVersion 7.1-
177-
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php74/ --standard=PHPCompatibilitySymfonyPolyfillPHP74 --runtime-set testVersion 7.1-
178-
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php80/ --standard=PHPCompatibilitySymfonyPolyfillPHP80 --runtime-set testVersion 7.1-
175+
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php72/ --standard=PHPCompatibilitySymfonyPolyfillPHP72 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 7.1-
176+
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php73/ --standard=PHPCompatibilitySymfonyPolyfillPHP73 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 7.1-
177+
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php74/ --standard=PHPCompatibilitySymfonyPolyfillPHP74 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 7.1-
178+
vendor/bin/phpcs -ps ./vendor/symfony/polyfill-php80/ --standard=PHPCompatibilitySymfonyPolyfillPHP80 --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 7.1-
179179
180180
# The polyfills for PHP 7.3 and higher are compatible with PHP 7.2+ at the current version.
181181
- name: "Test running against the polyfills - polyfills 7.3- (current)"

PHPCompatibilitySymfonyPolyfillPHP56/ruleset.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,11 @@
1111
<exclude name="PHPCompatibility.Constants.NewConstants.ldap_escape_dnFound"/>
1212
</rule>
1313

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

PHPCompatibilitySymfonyPolyfillPHP72/ruleset.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.mb_ordFound"/>
1919
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.mb_chrFound"/>
2020
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.mb_scrubFound"/>
21+
<exclude name="PHPCompatibility.FunctionUse.RemovedFunctions.utf8_encodeDeprecated"/>
22+
<exclude name="PHPCompatibility.FunctionUse.RemovedFunctions.utf8_decodeDeprecated"/>
2123
</rule>
2224

2325
<!-- Prevent false positives being thrown when run over the code of polyfill-php72 itself. -->

PHPCompatibilitySymfonyPolyfillPHP80/ruleset.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,9 @@
2222
<exclude name="PHPCompatibility.Classes.NewClasses.valueerrorFound"/>
2323
</rule>
2424

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

0 commit comments

Comments
 (0)