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_type_test() utility method to dedicated ContextHelper #2230

Merged
merged 1 commit into from
Apr 21, 2023

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Apr 20, 2023

The is_in_type_test() 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_type_test() method and the associated $typeTestFunctions property to the new WordPressCS\WordPress\Helpers\ContextHelper class and starts using that class in the relevant sniffs.

Related to #1465

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

The `is_in_type_test()` 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_type_test()` method and the associated `$typeTestFunctions` property to the new `WordPressCS\WordPress\Helpers\ContextHelper` class and starts using that class in the relevant sniffs.

Related to 1465

This method will be tested via the `WordPress.Security.NonceVerification` sniff (via pre-existing 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.

@GaryJones GaryJones merged commit 1cae1b3 into develop Apr 21, 2023
@GaryJones GaryJones deleted the feature/move-isintypetest-to-helper-class_ branch April 21, 2023 06:52
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