You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on #572, a number of other issues with the sniff caught my eye. A few of these will be addressed now in combination with #572, but there are also issues which are better left for when PHPCSUtils is in place.
Will be addressed now:
Handling of comments in the parameter.
Handling of 0 and values which evaluate to 0 being passed. 0 is the default value and will translate in the wp_cache_set() function internally as "no expiration".
One of the WP predefined time constants being passed on its own.
Edge cases, can be addressed later using Utils:
Prevent false positives for namespaced functions with the same name imported via a use function statement.
Prevent incorrect identification of namespaced constants with the same name as one of the WP time constants imported via a use const statement.
Handling of non-decimal numbers.
Handling of PHP 7.4 numeric literals with underscores.
Handling of other integer constants with known values.
More complex calculation handling (isNumericCalculation).
Handling of PHP 8.0 namespace names (as single token) for both the function name recognition as well as the WP time constant recognition.
Note: this is not a complete review, just notes as reminder for later.
Review the
WordPressVIPMinimum.Performance.LowExpiryCacheTime
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: