Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move is_in_function_call() utility method to dedicated ContextHelper #2229

Merged
merged 1 commit into from
Apr 20, 2023

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Apr 19, 2023

The is_in_function_call() utility method is only used by a small set of sniffs, so is better placed in a dedicated class.

This commit moves the is_in_function_call() method to the new WordPressCS\WordPress\Helpers\ContextHelper class and starts using that class in the relevant sniffs.

Includes adding a type declaration for the $valid_functions parameter.

Related to #1465

This method will be tested via the WordPress.Security.NonceVerification sniff (via pre-existing and a few new tests).

The `is_in_function_call()` utility method is only used by a small set of sniffs, so is better placed in a dedicated class.

This commit moves the `is_in_function_call()` method to the new `WordPressCS\WordPress\Helpers\ContextHelper` class and starts using that class in the relevant sniffs.

Includes adding a type declaration for the `$valid_functions` parameter.

Related to 1465

This method will be tested via the `WordPress.Security.NonceVerification` sniff (via pre-existing and a few new tests).
Copy link
Member

@GaryJones GaryJones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dingo-d dingo-d merged commit a25d821 into develop Apr 20, 2023
@dingo-d dingo-d deleted the feature/move-isinfunctioncall-to-helper-class branch April 20, 2023 06:18
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.

3 participants