Skip to content

Conversation

@jrfnl
Copy link
Member

@jrfnl jrfnl commented Aug 13, 2025

WP/EnqueuedResourceParameters: move parse error test to its own file

PHP 8.5 | WP/EnqueuedResourceParameters: prevent deprecation notice for non-standard casts

Four non-standard type casts are going to be deprecated in PHP 8.5.

When any of these type casts would be used in the parameter this sniff examines in the "code under scan" and the sniff would be run on PHP 8.5, the non-standard type cast would be executed via the eval(), leading to a deprecation notice, which would stop the scan of the file.

This commit works around this by always using the "standard" type cast syntax in the code which would be passed to eval().

Includes tests.

jrfnl added 2 commits August 13, 2025 02:29
…or non-standard casts

Four non-standard type casts are going to be deprecated in PHP 8.5.

When any of these type casts would be used in the parameter this sniff examines in the "code under scan" and the sniff would be run on PHP 8.5, the non-standard type cast would be executed via the `eval()`, leading to a deprecation notice, which would stop the scan of the file.

This commit works around this by always using the "standard" type cast syntax in the code which would be passed to `eval()`.

Includes tests.
@jrfnl
Copy link
Member Author

jrfnl commented Aug 13, 2025

Note: the remaining PHP 8.5 test failure can be ignored. This was a bug in PHP itself, which has already been fixed, it's just that the PHP 8.5 nightly image is a few days behind, so doesn't contain the fix yet.

@jrfnl
Copy link
Member Author

jrfnl commented Aug 21, 2025

I've retriggered the PHP 8.5 tests now the Composer issue has been fixed. Tests pass, so all good.

@dingo-d dingo-d merged commit 97ce822 into develop Aug 24, 2025
83 of 85 checks passed
@dingo-d dingo-d deleted the feature/php-8.5-prevent-error-for-deprecated-type-casts branch August 24, 2025 17:49
@jrfnl jrfnl modified the milestones: 3.2.x, 3.3.0 Sep 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants