Open jrfnl opened 4 years ago
From https://github.com/Automattic/VIP-Coding-Standards/pull/561#issue-457419501:
The parent
is_targetted_token()
method has diverged quite a bit from what is in the method in this class. Rather than address this now, I propose to address this once the improved/namespace and use context aware abstracts in PHPCSUtils are available as this sniff would benefit from switching over to such abstract.
Other than that for the custom code in the is_targetted_token()
method, some additional checks could be put in place to guard against both false positives as well as false negatives.
Currently the custom code checks for a particular variable name for an object. However:
For the switch over to the different parent class, I think it would be opportune to do this relatively quickly after the abstract becomes available as the sniff is looking for a large list of functions and these check would all benefit from the namespace awareness.
For adding additional checks for the object variable, IMO, this can be low priority as effectively the custom code is currently only used for one function check $wp_rewrite->flush_rules()
.
Review the
WordPressVIPMinimum.Functions.RestrictedFunctions
sniff for the following in as far as relevant to that sniff:list
statements::class
use function/const
Other:
Sniff basics, but changes need to be lined up for next major release:
public
properties (#234)Once PHPCS/PHPCSUtils supports this:
match
expressions