Skip to content

Commit c9b69bd

Browse files
authored
Merge pull request #101 from PHPCompatibility/feature/sync-with-polyfill-v1.4x.x
PHP 7.4, 8.3 + 8.5 polyfills: update the rulesets / sync with v1.4x.x
2 parents 8e2d0f6 + 372962e commit c9b69bd

5 files changed

Lines changed: 17 additions & 14 deletions

File tree

PHPCompatibilitySymfonyPolyfillPHP74/ruleset.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,9 @@
2121
<exclude-pattern>/polyfill[_-]php74/Php74\.php$</exclude-pattern>
2222
</rule>
2323

24+
<!-- Version toggle present. See: https://github.com/symfony/polyfill/pull/640 -->
25+
<rule ref="PHPCompatibility.Classes.NewClasses.valueerrorFound">
26+
<exclude-pattern>/polyfill[_-]php74/Php74\.php$</exclude-pattern>
27+
</rule>
28+
2429
</ruleset>

PHPCompatibilitySymfonyPolyfillPHP83/ruleset.xml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.ldap_exop_syncFound"/>
1616
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.ldap_connect_walletFound"/>
1717

18+
<!-- This is a PHP 8.0 feature, but is polyfilled in the PHP 8.3 package to polyfill certain PHP 8.3 features properly. -->
19+
<!-- See: https://github.com/symfony/polyfill/pull/637 -->
20+
<exclude name="PHPCompatibility.Classes.NewClasses.valueerrorFound"/>
21+
1822
<!-- https://github.com/symfony/polyfill-php83/tree/1.x/Resources/stubs -->
1923
<!--
2024
Detection for the Override attribute is incomplete in PHPCompatibility 10.0.0-alpha1.
@@ -79,11 +83,6 @@
7983
<exclude-pattern>/polyfill-php83/bootstrap81\.php$</exclude-pattern>
8084
</rule>
8185

82-
<!-- Version toggle present. See: https://github.com/symfony/polyfill/pull/501 -->
83-
<rule ref="PHPCompatibility.Classes.NewClasses.valueerrorFound">
84-
<exclude-pattern>/polyfill-php83/Php83\.php$</exclude-pattern>
85-
</rule>
86-
8786
<!-- See: https://github.com/symfony/polyfill/pull/594 -->
8887
<rule ref="PHPCompatibility.FunctionUse.NewFunctionParameters.ldap_exop_controlsFound">
8988
<exclude-pattern>/polyfill-php83/bootstrap\.php$</exclude-pattern>

PHPCompatibilitySymfonyPolyfillPHP85/ruleset.xml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.locale_is_right_to_leftFound"/>
1313
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.grapheme_levenshteinFound"/>
1414

15+
<!-- This is a PHP 8.0 feature, but is polyfilled in the PHP 8.3 package to polyfill certain PHP 8.3 features properly. -->
16+
<!-- See: https://github.com/symfony/polyfill/pull/637 -->
17+
<exclude name="PHPCompatibility.Classes.NewClasses.valueerrorFound"/>
18+
1519
<!-- https://github.com/symfony/polyfill-php85/tree/1.x/Resources/stubs -->
1620
<!--
1721
Detection for the DelayedTargetValidation and NoDiscard attributes is incomplete in PHPCompatibility 10.0.0-alpha1.
@@ -48,13 +52,4 @@
4852
<exclude-pattern>/polyfill-php85/bootstrap80\.php$</exclude-pattern>
4953
</rule>
5054

51-
<!--
52-
Not a false positive, but a bug in the Symfony PHP 8.5 polyfill package.
53-
Bug has been reported: ...
54-
Temporarily silencing the error as this needs to be solved upstream.
55-
-->
56-
<rule ref="PHPCompatibility.Classes.NewClasses.valueerrorFound">
57-
<exclude-pattern>/polyfill-php85/Php85\.php$</exclude-pattern>
58-
</rule>
59-
6055
</ruleset>

Test/SymfonyPolyfillPHP83Test.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ class Foo extends DateError {}
2424
} catch (DateObjectError | DateRangeError $e) {
2525
} catch (SQLite3Exception $e) {
2626
}
27+
28+
throw new ValueError();

Test/SymfonyPolyfillPHP85Test.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ function dummy() {}
2121

2222
locale_is_right_to_left($locale);
2323
grapheme_levenshtein( $s1, $s2 );
24+
25+
throw new ValueError();

0 commit comments

Comments
 (0)