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
The PHPCSUtils `PassedParameters::getParameters()` return value includes a `'clean'` array index, which contains the contents of the parameter stripped of surrounding whitespace and comments.
The `LowExpiryCacheTime` sniff uses the parameter contents in the error message, so using the `clean` value makes for a more readable error message.
Includes updating two pre-existing tests.
Before:
```
76 | WARNING | Cache expiry time could not be determined. Please inspect that the fourth parameter passed to wp_cache_set() evaluates to 300
| | seconds or more. Found: "20 * $time /*comment*/" (WordPressVIPMinimum.Performance.LowExpiryCacheTime.CacheTimeUndetermined)
```
After:
```
76 | WARNING | Cache expiry time could not be determined. Please inspect that the fourth parameter passed to wp_cache_set() evaluates to 300
| | seconds or more. Found: "20 * $time" (WordPressVIPMinimum.Performance.LowExpiryCacheTime.CacheTimeUndetermined)
```
Copy file name to clipboardExpand all lines: WordPressVIPMinimum/Sniffs/Performance/LowExpiryCacheTimeSniff.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -80,7 +80,7 @@ public function process_parameters( $stackPtr, $group_name, $matched_content, $p
80
80
81
81
$message = 'Cache expiry time could not be determined. Please inspect that the fourth parameter passed to %s() evaluates to 300 seconds or more. Found: "%s"';
0 commit comments