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 assignment" related utility to dedicated VariableHelper #2165

Merged
merged 1 commit into from
Dec 21, 2022

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Dec 20, 2022

The "is assignment" related utility method is only used by a small set of sniffs, so is better placed in a dedicated class.

As this method also primarily expects a T_VARIABLE token as input, the VariableHelper class seems appropriate.

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

Related to #1465

The "is assignment" related utility method is only used by a small set of sniffs, so is better placed in a dedicated class.

As this method also expects a `T_VARIABLE` token as input, the `VariableHelper` class seems appropriate.

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

Related to 1465
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 f6fda8b into develop Dec 21, 2022
@dingo-d dingo-d deleted the feature/move-is-assignment-to-variablehelper branch December 21, 2022 09:48
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