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

Hooks/AlwaysReturnInFilter: add support for hook-ins using short arrays #563

Merged

Conversation

jrfnl
Copy link
Collaborator

@jrfnl jrfnl commented Jul 28, 2020

As VIPCS is currently using WPCS 2.x, we can use the WPCS Sniff::find_array_open_close() method to get the opener/closer for an array independently of the type of array (long/short).

Once VIPCS implements PHPCSUtils, this method call should be swopped out for the PHPCSUtils Arrays::getOpenClose() method.

Addresses #358 for the AlwaysReturnInFilter sniff.

Includes unit tests.

As VIPCS is currently using WPCS 2.x, we can use the WPCS `Sniff::find_array_open_close()` method to get the opener/closer for an array independently of the type of array (long/short).

Once VIPCS implements PHPCSUtils, this method call should be swopped out for the PHPCSUtils `Arrays::getOpenClose()` method.

Addresses #358 for the `AlwaysReturnInFilter` sniff.

Includes unit tests.
@jrfnl jrfnl added this to the 2.2.0 milestone Jul 28, 2020
@jrfnl jrfnl requested a review from a team as a code owner July 28, 2020 01:03
@GaryJones GaryJones merged commit b0c949f into develop Jul 29, 2020
@GaryJones GaryJones deleted the fix/358-alwaysreturninfilter-support-short-arrays branch July 29, 2020 00:25
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.

2 participants