Skip to content

Conversation

@jrfnl
Copy link
Collaborator

@jrfnl jrfnl commented Jul 21, 2025

Constants/ConstantString: extend AbstractFunctionParameterSniff

As things were, the determination of whether or not a T_STRING is a call to the global PHP native define[d]() function was severely flawed.

By switching the sniff over to be based on the WordPressCS AbstractFunctionParameterSniff class, this flaw is mitigated.

Includes tests.

Constants/ConstantString: safeguard and document handling of various new php syntaxes

Constants/ConstantString: improve clarity of error message

Closes #512

jrfnl added 3 commits July 21, 2025 19:10
As things were, the determination of whether or not a `T_STRING` is a call to the global PHP native `define[d]()` function was severely flawed.

By switching the sniff over to be based on the WordPressCS `AbstractFunctionParameterSniff` class, this flaw is mitigated.

Includes tests.
@jrfnl jrfnl added this to the 3.1.0 milestone Jul 21, 2025
@jrfnl jrfnl requested a review from a team as a code owner July 21, 2025 17:31
@GaryJones GaryJones merged commit 025a1e0 into develop Jul 21, 2025
42 checks passed
@GaryJones GaryJones deleted the feature/constants-constantstring-sniff-review branch July 21, 2025 21:21
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.

Review the WordPressVIPMinimum.Constants.ConstantString sniff

3 participants