-
Notifications
You must be signed in to change notification settings - Fork 40
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
Review the WordPressVIPMinimum.Hooks.AlwaysReturnInFilter sniff #520
Comments
I've done an initial review of this sniff and the These sniffs can use quite some love. The age of the sniff is clearly showing through as code past the PHP 4 age is barely taken into account. Time to bring it into the modern age 😄 Findings:
Recommendations
All in all, this sniff (and the TimelineI'd recommend moving both this issue as well as the Note: this abstract is currently not available in PHPCSUtils and still needs work before it can be pulled to PHPCSUtils. Pertinent bugs can be patched up with quick fixes in the mean time if and when reported. |
Been thinking about this sniff some more. I think the wider WP community can benefit from this sniff, so once it is improved, this sniff would be a very strong candidate for moving to WPCS. I also think that a generic "function call with callback parameter" abstract sniff in PHPCSUtils may not be a bad idea. This abstract could then be the base for this sniff. Future scope for this sniff/the abstract (after the initial round of improvements):
|
From #783 - another thing which should be improved:
|
Review the
WordPressVIPMinimum.Hooks.AlwaysReturnInFilter
sniff for the following in as far as relevant to that sniff:Typical things to add tests for and verify correct handling of:
list
statementsTypical things to add tests for and verify correct handling of (where applicable):
::class
use function/const
Other:
Sniff basics, but changes need to be lined up for next major release:
public
properties (Audit Public Sniff Properties #234)Once PHPCS/PHPCSUtils supports this:
match
expressionsThe text was updated successfully, but these errors were encountered: