From e2421b744cc6e6bd913d75257c980b211790d1f1 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Wed, 22 Oct 2025 17:35:13 +0200 Subject: [PATCH] Polyfills 8.4/8.5: remove overzealous exclusion I already annotated when I added these attribute related exclusions that they weren't targeted enough and ran the risk of blanket ignoring more than we should. I've now decided to remove these as the excludes are too risky, meaning that end-users may end up missing legitimate PHP cross-version compatibility issues because of it. This highlights that more needs to change in how attributes are detected and flagged in PHPCompatibility itself. Once that improvement is made, these tests should be re-enabled and more targeted excludes should be added. Also see 74, which I have opened as a follow-up to this PR. --- PHPCompatibilitySymfonyPolyfillPHP84/ruleset.xml | 3 --- PHPCompatibilitySymfonyPolyfillPHP85/ruleset.xml | 3 --- Test/SymfonyPolyfillPHP84Test.php | 4 ++++ Test/SymfonyPolyfillPHP85Test.php | 4 ++++ 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/PHPCompatibilitySymfonyPolyfillPHP84/ruleset.xml b/PHPCompatibilitySymfonyPolyfillPHP84/ruleset.xml index 9e4381b..2347520 100644 --- a/PHPCompatibilitySymfonyPolyfillPHP84/ruleset.xml +++ b/PHPCompatibilitySymfonyPolyfillPHP84/ruleset.xml @@ -24,10 +24,7 @@ - diff --git a/PHPCompatibilitySymfonyPolyfillPHP85/ruleset.xml b/PHPCompatibilitySymfonyPolyfillPHP85/ruleset.xml index 542f0a9..4e4643e 100644 --- a/PHPCompatibilitySymfonyPolyfillPHP85/ruleset.xml +++ b/PHPCompatibilitySymfonyPolyfillPHP85/ruleset.xml @@ -14,10 +14,7 @@ - diff --git a/Test/SymfonyPolyfillPHP84Test.php b/Test/SymfonyPolyfillPHP84Test.php index 1da2bda..93f8d28 100644 --- a/Test/SymfonyPolyfillPHP84Test.php +++ b/Test/SymfonyPolyfillPHP84Test.php @@ -24,5 +24,9 @@ $r = new ReflectionConstant(ClassName::CONSTANT_NAME); +/* +// This test will not help at this time as we can't just ignore the use of the Deprecated attribute +// with the current attribute handling in PHPCompatibility 10.0. #[Deprecated] function foo() {} +*/ diff --git a/Test/SymfonyPolyfillPHP85Test.php b/Test/SymfonyPolyfillPHP85Test.php index 9da15e5..2a4a2d9 100644 --- a/Test/SymfonyPolyfillPHP85Test.php +++ b/Test/SymfonyPolyfillPHP85Test.php @@ -8,6 +8,10 @@ array_first($array); array_last($array); +/* +// This test will not help at this time as we can't just ignore the use of the DelayedTargetValidation/NoDiscard attribute +// with the current attribute handling in PHPCompatibility 10.0. #[DelayedTargetValidation] #[NoDiscard] function dummy() {} +*/