From 12154a65de39050aae86dcac126e8a6861742999 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Fri, 8 Nov 2024 11:02:40 +0100 Subject: [PATCH 1/6] Docs: improve consistency and specificity [1] This fixes up the `@return` type declarations for all `register()` methods. --- .../Sniffs/AbstractVariableRestrictionsSniff.php | 2 +- WordPressVIPMinimum/Sniffs/Constants/ConstantStringSniff.php | 2 +- .../Sniffs/Constants/RestrictedConstantsSniff.php | 2 +- WordPressVIPMinimum/Sniffs/Files/IncludingFileSniff.php | 2 +- WordPressVIPMinimum/Sniffs/Files/IncludingNonPHPFileSniff.php | 2 +- WordPressVIPMinimum/Sniffs/Functions/CheckReturnValueSniff.php | 2 +- WordPressVIPMinimum/Sniffs/Functions/DynamicCallsSniff.php | 2 +- WordPressVIPMinimum/Sniffs/Hooks/AlwaysReturnInFilterSniff.php | 2 +- WordPressVIPMinimum/Sniffs/Hooks/PreGetPostsSniff.php | 2 +- WordPressVIPMinimum/Sniffs/JS/DangerouslySetInnerHTMLSniff.php | 2 +- WordPressVIPMinimum/Sniffs/JS/HTMLExecutingFunctionsSniff.php | 2 +- WordPressVIPMinimum/Sniffs/JS/InnerHTMLSniff.php | 2 +- WordPressVIPMinimum/Sniffs/JS/StringConcatSniff.php | 2 +- WordPressVIPMinimum/Sniffs/JS/StrippingTagsSniff.php | 2 +- WordPressVIPMinimum/Sniffs/JS/WindowSniff.php | 2 +- .../Sniffs/Performance/CacheValueOverrideSniff.php | 2 +- .../Sniffs/Performance/FetchingRemoteDataSniff.php | 2 +- .../Sniffs/Performance/TaxonomyMetaInOptionsSniff.php | 2 +- .../Sniffs/Security/EscapingVoidReturnFunctionsSniff.php | 2 +- WordPressVIPMinimum/Sniffs/Security/ExitAfterRedirectSniff.php | 2 +- WordPressVIPMinimum/Sniffs/Security/MustacheSniff.php | 2 +- .../Sniffs/Security/ProperEscapingFunctionSniff.php | 2 +- WordPressVIPMinimum/Sniffs/Security/StaticStrreplaceSniff.php | 2 +- WordPressVIPMinimum/Sniffs/Security/TwigSniff.php | 2 +- WordPressVIPMinimum/Sniffs/Security/UnderscorejsSniff.php | 2 +- WordPressVIPMinimum/Sniffs/Security/VuejsSniff.php | 2 +- .../Sniffs/UserExperience/AdminBarRemovalSniff.php | 2 +- WordPressVIPMinimum/Sniffs/Variables/ServerVariablesSniff.php | 2 +- 28 files changed, 28 insertions(+), 28 deletions(-) diff --git a/WordPressVIPMinimum/Sniffs/AbstractVariableRestrictionsSniff.php b/WordPressVIPMinimum/Sniffs/AbstractVariableRestrictionsSniff.php index 06b61bfb..17317d14 100644 --- a/WordPressVIPMinimum/Sniffs/AbstractVariableRestrictionsSniff.php +++ b/WordPressVIPMinimum/Sniffs/AbstractVariableRestrictionsSniff.php @@ -58,7 +58,7 @@ abstract class AbstractVariableRestrictionsSniff extends Sniff { /** * Returns an array of tokens this test wants to listen for. * - * @return array + * @return array */ public function register() { // Retrieve the groups only once and don't set up a listener if there are no groups. diff --git a/WordPressVIPMinimum/Sniffs/Constants/ConstantStringSniff.php b/WordPressVIPMinimum/Sniffs/Constants/ConstantStringSniff.php index b2a8dafb..75db4dfe 100644 --- a/WordPressVIPMinimum/Sniffs/Constants/ConstantStringSniff.php +++ b/WordPressVIPMinimum/Sniffs/Constants/ConstantStringSniff.php @@ -20,7 +20,7 @@ class ConstantStringSniff extends Sniff { /** * Returns an array of tokens this test wants to listen for. * - * @return array + * @return array */ public function register() { return [ diff --git a/WordPressVIPMinimum/Sniffs/Constants/RestrictedConstantsSniff.php b/WordPressVIPMinimum/Sniffs/Constants/RestrictedConstantsSniff.php index 619c2631..fec79e06 100644 --- a/WordPressVIPMinimum/Sniffs/Constants/RestrictedConstantsSniff.php +++ b/WordPressVIPMinimum/Sniffs/Constants/RestrictedConstantsSniff.php @@ -38,7 +38,7 @@ class RestrictedConstantsSniff extends Sniff { /** * Returns an array of tokens this test wants to listen for. * - * @return array + * @return array */ public function register() { return [ diff --git a/WordPressVIPMinimum/Sniffs/Files/IncludingFileSniff.php b/WordPressVIPMinimum/Sniffs/Files/IncludingFileSniff.php index f1bfc2db..b6429051 100644 --- a/WordPressVIPMinimum/Sniffs/Files/IncludingFileSniff.php +++ b/WordPressVIPMinimum/Sniffs/Files/IncludingFileSniff.php @@ -107,7 +107,7 @@ public function getGroups() { /** * Returns an array of tokens this test wants to listen for. * - * @return array + * @return array */ public function register() { return Tokens::$includeTokens; diff --git a/WordPressVIPMinimum/Sniffs/Files/IncludingNonPHPFileSniff.php b/WordPressVIPMinimum/Sniffs/Files/IncludingNonPHPFileSniff.php index ab32dc9f..311dce7e 100644 --- a/WordPressVIPMinimum/Sniffs/Files/IncludingNonPHPFileSniff.php +++ b/WordPressVIPMinimum/Sniffs/Files/IncludingNonPHPFileSniff.php @@ -44,7 +44,7 @@ class IncludingNonPHPFileSniff extends Sniff { /** * Returns an array of tokens this test wants to listen for. * - * @return array + * @return array */ public function register() { return Tokens::$includeTokens; diff --git a/WordPressVIPMinimum/Sniffs/Functions/CheckReturnValueSniff.php b/WordPressVIPMinimum/Sniffs/Functions/CheckReturnValueSniff.php index 5eb40b2f..3fdbd936 100644 --- a/WordPressVIPMinimum/Sniffs/Functions/CheckReturnValueSniff.php +++ b/WordPressVIPMinimum/Sniffs/Functions/CheckReturnValueSniff.php @@ -57,7 +57,7 @@ class CheckReturnValueSniff extends Sniff { /** * Returns the token types that this sniff is interested in. * - * @return array(int) + * @return array */ public function register() { return [ T_STRING ]; diff --git a/WordPressVIPMinimum/Sniffs/Functions/DynamicCallsSniff.php b/WordPressVIPMinimum/Sniffs/Functions/DynamicCallsSniff.php index ca2f2acc..740cb5d3 100644 --- a/WordPressVIPMinimum/Sniffs/Functions/DynamicCallsSniff.php +++ b/WordPressVIPMinimum/Sniffs/Functions/DynamicCallsSniff.php @@ -62,7 +62,7 @@ class DynamicCallsSniff extends Sniff { /** * Returns the token types that this sniff is interested in. * - * @return array(int) + * @return array */ public function register() { return [ T_VARIABLE => T_VARIABLE ]; diff --git a/WordPressVIPMinimum/Sniffs/Hooks/AlwaysReturnInFilterSniff.php b/WordPressVIPMinimum/Sniffs/Hooks/AlwaysReturnInFilterSniff.php index 7bf70d9a..b9e966b4 100644 --- a/WordPressVIPMinimum/Sniffs/Hooks/AlwaysReturnInFilterSniff.php +++ b/WordPressVIPMinimum/Sniffs/Hooks/AlwaysReturnInFilterSniff.php @@ -27,7 +27,7 @@ class AlwaysReturnInFilterSniff extends Sniff { /** * Returns the token types that this sniff is interested in. * - * @return array(int) + * @return array */ public function register() { return [ T_STRING ]; diff --git a/WordPressVIPMinimum/Sniffs/Hooks/PreGetPostsSniff.php b/WordPressVIPMinimum/Sniffs/Hooks/PreGetPostsSniff.php index 88d49e62..07e5ce8d 100644 --- a/WordPressVIPMinimum/Sniffs/Hooks/PreGetPostsSniff.php +++ b/WordPressVIPMinimum/Sniffs/Hooks/PreGetPostsSniff.php @@ -21,7 +21,7 @@ class PreGetPostsSniff extends Sniff { /** * Returns the token types that this sniff is interested in. * - * @return array(int) + * @return array */ public function register() { return [ T_STRING ]; diff --git a/WordPressVIPMinimum/Sniffs/JS/DangerouslySetInnerHTMLSniff.php b/WordPressVIPMinimum/Sniffs/JS/DangerouslySetInnerHTMLSniff.php index ce68a775..f8ec0216 100644 --- a/WordPressVIPMinimum/Sniffs/JS/DangerouslySetInnerHTMLSniff.php +++ b/WordPressVIPMinimum/Sniffs/JS/DangerouslySetInnerHTMLSniff.php @@ -27,7 +27,7 @@ class DangerouslySetInnerHTMLSniff extends Sniff { /** * Returns an array of tokens this test wants to listen for. * - * @return array + * @return array */ public function register() { return [ diff --git a/WordPressVIPMinimum/Sniffs/JS/HTMLExecutingFunctionsSniff.php b/WordPressVIPMinimum/Sniffs/JS/HTMLExecutingFunctionsSniff.php index 0a106f22..373833ca 100644 --- a/WordPressVIPMinimum/Sniffs/JS/HTMLExecutingFunctionsSniff.php +++ b/WordPressVIPMinimum/Sniffs/JS/HTMLExecutingFunctionsSniff.php @@ -52,7 +52,7 @@ class HTMLExecutingFunctionsSniff extends Sniff { /** * Returns an array of tokens this test wants to listen for. * - * @return array + * @return array */ public function register() { return [ diff --git a/WordPressVIPMinimum/Sniffs/JS/InnerHTMLSniff.php b/WordPressVIPMinimum/Sniffs/JS/InnerHTMLSniff.php index f35f9894..8b235f77 100644 --- a/WordPressVIPMinimum/Sniffs/JS/InnerHTMLSniff.php +++ b/WordPressVIPMinimum/Sniffs/JS/InnerHTMLSniff.php @@ -27,7 +27,7 @@ class InnerHTMLSniff extends Sniff { /** * Returns an array of tokens this test wants to listen for. * - * @return array + * @return array */ public function register() { return [ diff --git a/WordPressVIPMinimum/Sniffs/JS/StringConcatSniff.php b/WordPressVIPMinimum/Sniffs/JS/StringConcatSniff.php index 049b35c0..17eb4445 100644 --- a/WordPressVIPMinimum/Sniffs/JS/StringConcatSniff.php +++ b/WordPressVIPMinimum/Sniffs/JS/StringConcatSniff.php @@ -27,7 +27,7 @@ class StringConcatSniff extends Sniff { /** * Returns an array of tokens this test wants to listen for. * - * @return array + * @return array */ public function register() { return [ diff --git a/WordPressVIPMinimum/Sniffs/JS/StrippingTagsSniff.php b/WordPressVIPMinimum/Sniffs/JS/StrippingTagsSniff.php index 88fef947..2b38105e 100644 --- a/WordPressVIPMinimum/Sniffs/JS/StrippingTagsSniff.php +++ b/WordPressVIPMinimum/Sniffs/JS/StrippingTagsSniff.php @@ -27,7 +27,7 @@ class StrippingTagsSniff extends Sniff { /** * Returns an array of tokens this test wants to listen for. * - * @return array + * @return array */ public function register() { return [ diff --git a/WordPressVIPMinimum/Sniffs/JS/WindowSniff.php b/WordPressVIPMinimum/Sniffs/JS/WindowSniff.php index d54d5690..3e292dfa 100644 --- a/WordPressVIPMinimum/Sniffs/JS/WindowSniff.php +++ b/WordPressVIPMinimum/Sniffs/JS/WindowSniff.php @@ -27,7 +27,7 @@ class WindowSniff extends Sniff { /** * Returns an array of tokens this test wants to listen for. * - * @return array + * @return array */ public function register() { return [ diff --git a/WordPressVIPMinimum/Sniffs/Performance/CacheValueOverrideSniff.php b/WordPressVIPMinimum/Sniffs/Performance/CacheValueOverrideSniff.php index 8d39c1a2..b1acb06f 100644 --- a/WordPressVIPMinimum/Sniffs/Performance/CacheValueOverrideSniff.php +++ b/WordPressVIPMinimum/Sniffs/Performance/CacheValueOverrideSniff.php @@ -18,7 +18,7 @@ class CacheValueOverrideSniff extends Sniff { /** * Returns the token types that this sniff is interested in. * - * @return array(int) + * @return array */ public function register() { return [ T_STRING ]; diff --git a/WordPressVIPMinimum/Sniffs/Performance/FetchingRemoteDataSniff.php b/WordPressVIPMinimum/Sniffs/Performance/FetchingRemoteDataSniff.php index fab5eada..823f2a8d 100644 --- a/WordPressVIPMinimum/Sniffs/Performance/FetchingRemoteDataSniff.php +++ b/WordPressVIPMinimum/Sniffs/Performance/FetchingRemoteDataSniff.php @@ -19,7 +19,7 @@ class FetchingRemoteDataSniff extends Sniff { /** * Returns an array of tokens this test wants to listen for. * - * @return array + * @return array */ public function register() { return [ T_STRING ]; diff --git a/WordPressVIPMinimum/Sniffs/Performance/TaxonomyMetaInOptionsSniff.php b/WordPressVIPMinimum/Sniffs/Performance/TaxonomyMetaInOptionsSniff.php index 07607275..a2c50420 100644 --- a/WordPressVIPMinimum/Sniffs/Performance/TaxonomyMetaInOptionsSniff.php +++ b/WordPressVIPMinimum/Sniffs/Performance/TaxonomyMetaInOptionsSniff.php @@ -46,7 +46,7 @@ class TaxonomyMetaInOptionsSniff extends Sniff { /** * Returns an array of tokens this test wants to listen for. * - * @return array + * @return array */ public function register() { return [ T_STRING ]; diff --git a/WordPressVIPMinimum/Sniffs/Security/EscapingVoidReturnFunctionsSniff.php b/WordPressVIPMinimum/Sniffs/Security/EscapingVoidReturnFunctionsSniff.php index 6a6ba281..93c959cd 100644 --- a/WordPressVIPMinimum/Sniffs/Security/EscapingVoidReturnFunctionsSniff.php +++ b/WordPressVIPMinimum/Sniffs/Security/EscapingVoidReturnFunctionsSniff.php @@ -26,7 +26,7 @@ class EscapingVoidReturnFunctionsSniff extends Sniff { /** * Returns an array of tokens this test wants to listen for. * - * @return array + * @return array */ public function register() { return [ diff --git a/WordPressVIPMinimum/Sniffs/Security/ExitAfterRedirectSniff.php b/WordPressVIPMinimum/Sniffs/Security/ExitAfterRedirectSniff.php index 3c90c315..f41e4d82 100644 --- a/WordPressVIPMinimum/Sniffs/Security/ExitAfterRedirectSniff.php +++ b/WordPressVIPMinimum/Sniffs/Security/ExitAfterRedirectSniff.php @@ -19,7 +19,7 @@ class ExitAfterRedirectSniff extends Sniff { /** * Returns an array of tokens this test wants to listen for. * - * @return array + * @return array */ public function register() { return [ T_STRING ]; diff --git a/WordPressVIPMinimum/Sniffs/Security/MustacheSniff.php b/WordPressVIPMinimum/Sniffs/Security/MustacheSniff.php index b026b443..68cc423c 100644 --- a/WordPressVIPMinimum/Sniffs/Security/MustacheSniff.php +++ b/WordPressVIPMinimum/Sniffs/Security/MustacheSniff.php @@ -25,7 +25,7 @@ class MustacheSniff extends Sniff { /** * Returns an array of tokens this test wants to listen for. * - * @return array + * @return array */ public function register() { return [ diff --git a/WordPressVIPMinimum/Sniffs/Security/ProperEscapingFunctionSniff.php b/WordPressVIPMinimum/Sniffs/Security/ProperEscapingFunctionSniff.php index 12ee05c7..1a9e9334 100644 --- a/WordPressVIPMinimum/Sniffs/Security/ProperEscapingFunctionSniff.php +++ b/WordPressVIPMinimum/Sniffs/Security/ProperEscapingFunctionSniff.php @@ -107,7 +107,7 @@ class ProperEscapingFunctionSniff extends Sniff { /** * Returns an array of tokens this test wants to listen for. * - * @return array + * @return array */ public function register() { $this->echo_or_concat_tokens += Tokens::$emptyTokens; diff --git a/WordPressVIPMinimum/Sniffs/Security/StaticStrreplaceSniff.php b/WordPressVIPMinimum/Sniffs/Security/StaticStrreplaceSniff.php index 58e90e74..612e8845 100644 --- a/WordPressVIPMinimum/Sniffs/Security/StaticStrreplaceSniff.php +++ b/WordPressVIPMinimum/Sniffs/Security/StaticStrreplaceSniff.php @@ -19,7 +19,7 @@ class StaticStrreplaceSniff extends Sniff { /** * Returns an array of tokens this test wants to listen for. * - * @return array + * @return array */ public function register() { return [ T_STRING ]; diff --git a/WordPressVIPMinimum/Sniffs/Security/TwigSniff.php b/WordPressVIPMinimum/Sniffs/Security/TwigSniff.php index fdc8f643..e1a5abed 100644 --- a/WordPressVIPMinimum/Sniffs/Security/TwigSniff.php +++ b/WordPressVIPMinimum/Sniffs/Security/TwigSniff.php @@ -25,7 +25,7 @@ class TwigSniff extends Sniff { /** * Returns an array of tokens this test wants to listen for. * - * @return array + * @return array */ public function register() { return [ diff --git a/WordPressVIPMinimum/Sniffs/Security/UnderscorejsSniff.php b/WordPressVIPMinimum/Sniffs/Security/UnderscorejsSniff.php index ecb40db2..7bb0d698 100644 --- a/WordPressVIPMinimum/Sniffs/Security/UnderscorejsSniff.php +++ b/WordPressVIPMinimum/Sniffs/Security/UnderscorejsSniff.php @@ -50,7 +50,7 @@ class UnderscorejsSniff extends Sniff { /** * Returns an array of tokens this test wants to listen for. * - * @return array + * @return array */ public function register() { $targets = Tokens::$textStringTokens; diff --git a/WordPressVIPMinimum/Sniffs/Security/VuejsSniff.php b/WordPressVIPMinimum/Sniffs/Security/VuejsSniff.php index 7f9d9e73..bf7de67a 100644 --- a/WordPressVIPMinimum/Sniffs/Security/VuejsSniff.php +++ b/WordPressVIPMinimum/Sniffs/Security/VuejsSniff.php @@ -25,7 +25,7 @@ class VuejsSniff extends Sniff { /** * Returns an array of tokens this test wants to listen for. * - * @return array + * @return array */ public function register() { return [ diff --git a/WordPressVIPMinimum/Sniffs/UserExperience/AdminBarRemovalSniff.php b/WordPressVIPMinimum/Sniffs/UserExperience/AdminBarRemovalSniff.php index 3db0aea6..b4c986cb 100644 --- a/WordPressVIPMinimum/Sniffs/UserExperience/AdminBarRemovalSniff.php +++ b/WordPressVIPMinimum/Sniffs/UserExperience/AdminBarRemovalSniff.php @@ -118,7 +118,7 @@ class AdminBarRemovalSniff extends AbstractFunctionParameterSniff { /** * Returns an array of tokens this test wants to listen for. * - * @return array + * @return array */ public function register() { // Set up all string targets. diff --git a/WordPressVIPMinimum/Sniffs/Variables/ServerVariablesSniff.php b/WordPressVIPMinimum/Sniffs/Variables/ServerVariablesSniff.php index 09f00bf9..47ce66ec 100644 --- a/WordPressVIPMinimum/Sniffs/Variables/ServerVariablesSniff.php +++ b/WordPressVIPMinimum/Sniffs/Variables/ServerVariablesSniff.php @@ -35,7 +35,7 @@ class ServerVariablesSniff extends Sniff { /** * Returns an array of tokens this test wants to listen for. * - * @return array + * @return array */ public function register() { return [ From 3a56af30559b44ece96c551e4ddae309f273c781 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Fri, 8 Nov 2024 11:52:52 +0100 Subject: [PATCH 2/6] Docs: improve consistency and specificity [2] This fixes up the `@var` type declarations for all `AbstractFunctionParameterSniff::$target_functions` properties. --- WordPressVIPMinimum/Sniffs/Functions/StripTagsSniff.php | 5 +---- WordPressVIPMinimum/Sniffs/Hooks/RestrictedHooksSniff.php | 5 +---- .../Sniffs/Performance/LowExpiryCacheTimeSniff.php | 5 +---- .../Sniffs/Security/PHPFilterFunctionsSniff.php | 5 +---- .../Sniffs/UserExperience/AdminBarRemovalSniff.php | 2 +- 5 files changed, 5 insertions(+), 17 deletions(-) diff --git a/WordPressVIPMinimum/Sniffs/Functions/StripTagsSniff.php b/WordPressVIPMinimum/Sniffs/Functions/StripTagsSniff.php index cf29e454..a06b01c2 100644 --- a/WordPressVIPMinimum/Sniffs/Functions/StripTagsSniff.php +++ b/WordPressVIPMinimum/Sniffs/Functions/StripTagsSniff.php @@ -26,10 +26,7 @@ class StripTagsSniff extends AbstractFunctionParameterSniff { /** * Functions this sniff is looking for. * - * @var array The only requirement for this array is that the top level - * array keys are the names of the functions you're looking for. - * Other than that, the array can have arbitrary content - * depending on your needs. + * @var array Key is the function name, value irrelevant. */ protected $target_functions = [ 'strip_tags' => true, diff --git a/WordPressVIPMinimum/Sniffs/Hooks/RestrictedHooksSniff.php b/WordPressVIPMinimum/Sniffs/Hooks/RestrictedHooksSniff.php index d15dac7d..5908a702 100644 --- a/WordPressVIPMinimum/Sniffs/Hooks/RestrictedHooksSniff.php +++ b/WordPressVIPMinimum/Sniffs/Hooks/RestrictedHooksSniff.php @@ -26,10 +26,7 @@ class RestrictedHooksSniff extends AbstractFunctionParameterSniff { /** * Functions this sniff is looking for. * - * @var array The only requirement for this array is that the top level - * array keys are the names of the functions you're looking for. - * Other than that, the array can have arbitrary content - * depending on your needs. + * @var array Key is the function name, value irrelevant. */ protected $target_functions = [ 'add_filter' => true, diff --git a/WordPressVIPMinimum/Sniffs/Performance/LowExpiryCacheTimeSniff.php b/WordPressVIPMinimum/Sniffs/Performance/LowExpiryCacheTimeSniff.php index cededb87..105b38ac 100644 --- a/WordPressVIPMinimum/Sniffs/Performance/LowExpiryCacheTimeSniff.php +++ b/WordPressVIPMinimum/Sniffs/Performance/LowExpiryCacheTimeSniff.php @@ -30,10 +30,7 @@ class LowExpiryCacheTimeSniff extends AbstractFunctionParameterSniff { /** * Functions this sniff is looking for. * - * @var array The only requirement for this array is that the top level - * array keys are the names of the functions you're looking for. - * Other than that, the array can have arbitrary content - * depending on your needs. + * @var array Key is the function name, value irrelevant. */ protected $target_functions = [ 'wp_cache_set' => true, diff --git a/WordPressVIPMinimum/Sniffs/Security/PHPFilterFunctionsSniff.php b/WordPressVIPMinimum/Sniffs/Security/PHPFilterFunctionsSniff.php index e2907d9a..34c73014 100644 --- a/WordPressVIPMinimum/Sniffs/Security/PHPFilterFunctionsSniff.php +++ b/WordPressVIPMinimum/Sniffs/Security/PHPFilterFunctionsSniff.php @@ -26,10 +26,7 @@ class PHPFilterFunctionsSniff extends AbstractFunctionParameterSniff { /** * Functions this sniff is looking for. * - * @var array The only requirement for this array is that the top level - * array keys are the names of the functions you're looking for. - * Other than that, the array can have arbitrary content - * depending on your needs. + * @var array Key is the function name, value irrelevant. */ protected $target_functions = [ 'filter_var' => true, diff --git a/WordPressVIPMinimum/Sniffs/UserExperience/AdminBarRemovalSniff.php b/WordPressVIPMinimum/Sniffs/UserExperience/AdminBarRemovalSniff.php index b4c986cb..51b69d80 100644 --- a/WordPressVIPMinimum/Sniffs/UserExperience/AdminBarRemovalSniff.php +++ b/WordPressVIPMinimum/Sniffs/UserExperience/AdminBarRemovalSniff.php @@ -48,7 +48,7 @@ class AdminBarRemovalSniff extends AbstractFunctionParameterSniff { /** * Functions this sniff is looking for. * - * @var array + * @var array Key is the function name, value irrelevant. */ protected $target_functions = [ 'show_admin_bar' => true, From 02b07facd04248e80b9db08cefb066693a2f2fe1 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Fri, 8 Nov 2024 11:54:55 +0100 Subject: [PATCH 3/6] Docs: improve consistency and specificity [3] This fixes up the `@return` type declarations for all `AbstractVariableRestrictionsSniff::getGroups()` methods. --- .../Sniffs/AbstractVariableRestrictionsSniff.php | 2 +- .../Sniffs/Variables/RestrictedVariablesSniff.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WordPressVIPMinimum/Sniffs/AbstractVariableRestrictionsSniff.php b/WordPressVIPMinimum/Sniffs/AbstractVariableRestrictionsSniff.php index 17317d14..437c33c0 100644 --- a/WordPressVIPMinimum/Sniffs/AbstractVariableRestrictionsSniff.php +++ b/WordPressVIPMinimum/Sniffs/AbstractVariableRestrictionsSniff.php @@ -91,7 +91,7 @@ public function register() { * ) * ) * - * @return array + * @return array>> */ abstract public function getGroups(); diff --git a/WordPressVIPMinimum/Sniffs/Variables/RestrictedVariablesSniff.php b/WordPressVIPMinimum/Sniffs/Variables/RestrictedVariablesSniff.php index 65687642..3e1275cb 100644 --- a/WordPressVIPMinimum/Sniffs/Variables/RestrictedVariablesSniff.php +++ b/WordPressVIPMinimum/Sniffs/Variables/RestrictedVariablesSniff.php @@ -31,7 +31,7 @@ class RestrictedVariablesSniff extends AbstractVariableRestrictionsSniff { * ) * ) * - * @return array + * @return array>> */ public function getGroups() { return [ From 6ab21f81a5bde4d33b51f174d5509fb684003b86 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Fri, 8 Nov 2024 12:00:09 +0100 Subject: [PATCH 4/6] Docs: improve consistency and specificity [4] This fixes up the `@return` type declarations for all `AbstractArrayAssignmentRestrictionsSniff::getGroups()` methods. --- WordPressVIPMinimum/Sniffs/Performance/NoPagingSniff.php | 2 +- WordPressVIPMinimum/Sniffs/Performance/OrderByRandSniff.php | 2 +- WordPressVIPMinimum/Sniffs/Performance/RegexpCompareSniff.php | 2 +- .../Sniffs/Performance/RemoteRequestTimeoutSniff.php | 2 +- WordPressVIPMinimum/Sniffs/Performance/WPQueryParamsSniff.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/WordPressVIPMinimum/Sniffs/Performance/NoPagingSniff.php b/WordPressVIPMinimum/Sniffs/Performance/NoPagingSniff.php index c751f021..4aca9ddd 100644 --- a/WordPressVIPMinimum/Sniffs/Performance/NoPagingSniff.php +++ b/WordPressVIPMinimum/Sniffs/Performance/NoPagingSniff.php @@ -23,7 +23,7 @@ class NoPagingSniff extends AbstractArrayAssignmentRestrictionsSniff { /** * Groups of variables to restrict. * - * @return array + * @return array>> */ public function getGroups() { return [ diff --git a/WordPressVIPMinimum/Sniffs/Performance/OrderByRandSniff.php b/WordPressVIPMinimum/Sniffs/Performance/OrderByRandSniff.php index 2747b242..a9531d71 100644 --- a/WordPressVIPMinimum/Sniffs/Performance/OrderByRandSniff.php +++ b/WordPressVIPMinimum/Sniffs/Performance/OrderByRandSniff.php @@ -24,7 +24,7 @@ class OrderByRandSniff extends AbstractArrayAssignmentRestrictionsSniff { /** * Groups of variables to restrict. * - * @return array + * @return array>> */ public function getGroups() { return [ diff --git a/WordPressVIPMinimum/Sniffs/Performance/RegexpCompareSniff.php b/WordPressVIPMinimum/Sniffs/Performance/RegexpCompareSniff.php index 536bd1ee..c12ed35d 100644 --- a/WordPressVIPMinimum/Sniffs/Performance/RegexpCompareSniff.php +++ b/WordPressVIPMinimum/Sniffs/Performance/RegexpCompareSniff.php @@ -18,7 +18,7 @@ class RegexpCompareSniff extends AbstractArrayAssignmentRestrictionsSniff { /** * Groups of variables to restrict. * - * @return array + * @return array>> */ public function getGroups() { return [ diff --git a/WordPressVIPMinimum/Sniffs/Performance/RemoteRequestTimeoutSniff.php b/WordPressVIPMinimum/Sniffs/Performance/RemoteRequestTimeoutSniff.php index 072ba5af..266a5c55 100644 --- a/WordPressVIPMinimum/Sniffs/Performance/RemoteRequestTimeoutSniff.php +++ b/WordPressVIPMinimum/Sniffs/Performance/RemoteRequestTimeoutSniff.php @@ -17,7 +17,7 @@ class RemoteRequestTimeoutSniff extends AbstractArrayAssignmentRestrictionsSniff /** * Groups of variables to restrict. * - * @return array + * @return array>> */ public function getGroups() { return [ diff --git a/WordPressVIPMinimum/Sniffs/Performance/WPQueryParamsSniff.php b/WordPressVIPMinimum/Sniffs/Performance/WPQueryParamsSniff.php index 9c247f8d..2b004c9c 100644 --- a/WordPressVIPMinimum/Sniffs/Performance/WPQueryParamsSniff.php +++ b/WordPressVIPMinimum/Sniffs/Performance/WPQueryParamsSniff.php @@ -28,7 +28,7 @@ class WPQueryParamsSniff extends AbstractArrayAssignmentRestrictionsSniff { /** * Groups of variables to restrict. * - * @return array + * @return array>> */ public function getGroups() { return [ From b95dde72e15c5493a81c93a4ea4577f28ffdf3d7 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Fri, 8 Nov 2024 11:14:54 +0100 Subject: [PATCH 5/6] DeclarationCompatibility::$checkClasses: improve type specificity --- .../Sniffs/Classes/DeclarationCompatibilitySniff.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WordPressVIPMinimum/Sniffs/Classes/DeclarationCompatibilitySniff.php b/WordPressVIPMinimum/Sniffs/Classes/DeclarationCompatibilitySniff.php index a71b4907..d610933b 100644 --- a/WordPressVIPMinimum/Sniffs/Classes/DeclarationCompatibilitySniff.php +++ b/WordPressVIPMinimum/Sniffs/Classes/DeclarationCompatibilitySniff.php @@ -27,7 +27,7 @@ class DeclarationCompatibilitySniff extends AbstractScopeSniff { /** * A list of classes and methods to check. * - * @var array>> + * @var array>>> */ public $checkClasses = [ 'WP_Widget' => [ From 97d83d589de20088d163ed35b2b809899a84fa1e Mon Sep 17 00:00:00 2001 From: jrfnl Date: Fri, 8 Nov 2024 12:04:39 +0100 Subject: [PATCH 6/6] Docs: improve specificity Miscellaneous other doc specificity fixes. Note: this doesn't fix everything throughout the codebase, but is an iteration to improve things nonetheless. --- .../Sniffs/Classes/DeclarationCompatibilitySniff.php | 2 +- .../Sniffs/Classes/RestrictedExtendClassesSniff.php | 2 +- .../Sniffs/Constants/RestrictedConstantsSniff.php | 4 ++-- .../Sniffs/Files/IncludingFileSniff.php | 10 +++++----- .../Sniffs/Files/IncludingNonPHPFileSniff.php | 4 ++-- .../Sniffs/Functions/CheckReturnValueSniff.php | 6 +++--- .../Sniffs/Functions/DynamicCallsSniff.php | 4 ++-- .../Sniffs/Functions/RestrictedFunctionsSniff.php | 2 +- .../Sniffs/Hooks/RestrictedHooksSniff.php | 2 +- .../Sniffs/JS/HTMLExecutingFunctionsSniff.php | 2 +- WordPressVIPMinimum/Sniffs/JS/StringConcatSniff.php | 4 ++-- WordPressVIPMinimum/Sniffs/JS/WindowSniff.php | 2 +- .../Sniffs/Performance/LowExpiryCacheTimeSniff.php | 2 +- .../Sniffs/Performance/TaxonomyMetaInOptionsSniff.php | 4 ++-- .../Sniffs/Security/PHPFilterFunctionsSniff.php | 2 +- .../Sniffs/Security/ProperEscapingFunctionSniff.php | 8 ++++---- .../Sniffs/UserExperience/AdminBarRemovalSniff.php | 8 ++++---- .../Sniffs/Variables/ServerVariablesSniff.php | 2 +- tests/RulesetTest.php | 6 +++--- 19 files changed, 38 insertions(+), 38 deletions(-) diff --git a/WordPressVIPMinimum/Sniffs/Classes/DeclarationCompatibilitySniff.php b/WordPressVIPMinimum/Sniffs/Classes/DeclarationCompatibilitySniff.php index d610933b..57419759 100644 --- a/WordPressVIPMinimum/Sniffs/Classes/DeclarationCompatibilitySniff.php +++ b/WordPressVIPMinimum/Sniffs/Classes/DeclarationCompatibilitySniff.php @@ -315,7 +315,7 @@ private function addError( $parentClassName, $methodName, $currentMethodSignatur * * @param array $methodSignature Signature of a method. * - * @return array + * @return array */ private function generateParamList( $methodSignature ) { $paramList = []; diff --git a/WordPressVIPMinimum/Sniffs/Classes/RestrictedExtendClassesSniff.php b/WordPressVIPMinimum/Sniffs/Classes/RestrictedExtendClassesSniff.php index a8b076a2..94eaf5a2 100644 --- a/WordPressVIPMinimum/Sniffs/Classes/RestrictedExtendClassesSniff.php +++ b/WordPressVIPMinimum/Sniffs/Classes/RestrictedExtendClassesSniff.php @@ -19,7 +19,7 @@ class RestrictedExtendClassesSniff extends AbstractClassRestrictionsSniff { /** * Groups of classes to restrict. * - * @return array + * @return array>> */ public function getGroups() { return [ diff --git a/WordPressVIPMinimum/Sniffs/Constants/RestrictedConstantsSniff.php b/WordPressVIPMinimum/Sniffs/Constants/RestrictedConstantsSniff.php index fec79e06..055f1aba 100644 --- a/WordPressVIPMinimum/Sniffs/Constants/RestrictedConstantsSniff.php +++ b/WordPressVIPMinimum/Sniffs/Constants/RestrictedConstantsSniff.php @@ -19,7 +19,7 @@ class RestrictedConstantsSniff extends Sniff { /** * List of restricted constant names. * - * @var array + * @var array */ public $restrictedConstantNames = [ 'A8C_PROXIED_REQUEST', @@ -28,7 +28,7 @@ class RestrictedConstantsSniff extends Sniff { /** * List of restricted constant declarations. * - * @var array + * @var array */ public $restrictedConstantDeclaration = [ 'JETPACK_DEV_DEBUG', diff --git a/WordPressVIPMinimum/Sniffs/Files/IncludingFileSniff.php b/WordPressVIPMinimum/Sniffs/Files/IncludingFileSniff.php index b6429051..7aea965b 100644 --- a/WordPressVIPMinimum/Sniffs/Files/IncludingFileSniff.php +++ b/WordPressVIPMinimum/Sniffs/Files/IncludingFileSniff.php @@ -20,7 +20,7 @@ class IncludingFileSniff extends AbstractFunctionRestrictionsSniff { /** * List of function used for getting paths. * - * @var array + * @var array */ public $getPathFunctions = [ 'dirname', @@ -55,7 +55,7 @@ class IncludingFileSniff extends AbstractFunctionRestrictionsSniff { /** * List of restricted constants. * - * @var array + * @var array */ public $restrictedConstants = [ 'TEMPLATEPATH' => 'get_template_directory', @@ -65,7 +65,7 @@ class IncludingFileSniff extends AbstractFunctionRestrictionsSniff { /** * List of allowed constants. * - * @var array + * @var array */ public $allowedConstants = [ 'ABSPATH', @@ -77,7 +77,7 @@ class IncludingFileSniff extends AbstractFunctionRestrictionsSniff { * List of keywords allowed for use in custom constants. * Note: Customizing this property will overwrite current default values. * - * @var array + * @var array */ public $allowedKeywords = [ 'PATH', @@ -87,7 +87,7 @@ class IncludingFileSniff extends AbstractFunctionRestrictionsSniff { /** * Functions used for modify slashes. * - * @var array + * @var array */ public $slashingFunctions = [ 'trailingslashit', diff --git a/WordPressVIPMinimum/Sniffs/Files/IncludingNonPHPFileSniff.php b/WordPressVIPMinimum/Sniffs/Files/IncludingNonPHPFileSniff.php index 311dce7e..342edd19 100644 --- a/WordPressVIPMinimum/Sniffs/Files/IncludingNonPHPFileSniff.php +++ b/WordPressVIPMinimum/Sniffs/Files/IncludingNonPHPFileSniff.php @@ -23,7 +23,7 @@ class IncludingNonPHPFileSniff extends Sniff { * * Files with these extensions are allowed to be `include`d. * - * @var array Key is the extension, value is irrelevant. + * @var array Key is the extension, value is irrelevant. */ private $php_extensions = [ 'php' => true, @@ -34,7 +34,7 @@ class IncludingNonPHPFileSniff extends Sniff { /** * File extensions used for SVG and CSS files. * - * @var array Key is the extension, value is irrelevant. + * @var array Key is the extension, value is irrelevant. */ private $svg_css_extensions = [ 'css' => true, diff --git a/WordPressVIPMinimum/Sniffs/Functions/CheckReturnValueSniff.php b/WordPressVIPMinimum/Sniffs/Functions/CheckReturnValueSniff.php index 3fdbd936..3bf6c0df 100644 --- a/WordPressVIPMinimum/Sniffs/Functions/CheckReturnValueSniff.php +++ b/WordPressVIPMinimum/Sniffs/Functions/CheckReturnValueSniff.php @@ -24,7 +24,7 @@ class CheckReturnValueSniff extends Sniff { /** * Pairs we are about to check. * - * @var array + * @var array> */ public $catch = [ 'esc_url' => [ @@ -48,7 +48,7 @@ class CheckReturnValueSniff extends Sniff { /** * Tokens we are about to examine, which are not functions. * - * @var array + * @var array */ public $notFunctions = [ 'foreach' => T_FOREACH, @@ -293,7 +293,7 @@ public function findNonCheckedVariables( $stackPtr ) { * Function used as as callback for the array_reduce call. * * @param string|null $carry The final string. - * @param mixed $item Processed item. + * @param array $item Processed item. * * @return string */ diff --git a/WordPressVIPMinimum/Sniffs/Functions/DynamicCallsSniff.php b/WordPressVIPMinimum/Sniffs/Functions/DynamicCallsSniff.php index 740cb5d3..50abf546 100644 --- a/WordPressVIPMinimum/Sniffs/Functions/DynamicCallsSniff.php +++ b/WordPressVIPMinimum/Sniffs/Functions/DynamicCallsSniff.php @@ -29,7 +29,7 @@ class DynamicCallsSniff extends Sniff { /** * Functions that should not be called dynamically. * - * @var array + * @var array */ private $disallowed_functions = [ 'assert' => true, @@ -48,7 +48,7 @@ class DynamicCallsSniff extends Sniff { * * Populated at run-time. * - * @var array The key is the name of the variable, the value, its assigned value. + * @var array The key is the name of the variable, the value, its assigned value. */ private $variables_arr = []; diff --git a/WordPressVIPMinimum/Sniffs/Functions/RestrictedFunctionsSniff.php b/WordPressVIPMinimum/Sniffs/Functions/RestrictedFunctionsSniff.php index 4513140c..debdec70 100644 --- a/WordPressVIPMinimum/Sniffs/Functions/RestrictedFunctionsSniff.php +++ b/WordPressVIPMinimum/Sniffs/Functions/RestrictedFunctionsSniff.php @@ -18,7 +18,7 @@ class RestrictedFunctionsSniff extends AbstractFunctionRestrictionsSniff { /** * Groups of functions to restrict. * - * @return array + * @return array|array>> */ public function getGroups() { diff --git a/WordPressVIPMinimum/Sniffs/Hooks/RestrictedHooksSniff.php b/WordPressVIPMinimum/Sniffs/Hooks/RestrictedHooksSniff.php index 5908a702..bfe524e6 100644 --- a/WordPressVIPMinimum/Sniffs/Hooks/RestrictedHooksSniff.php +++ b/WordPressVIPMinimum/Sniffs/Hooks/RestrictedHooksSniff.php @@ -36,7 +36,7 @@ class RestrictedHooksSniff extends AbstractFunctionParameterSniff { /** * List of restricted filters by groups. * - * @var array + * @var array>> */ private $restricted_hook_groups = [ 'upload_mimes' => [ diff --git a/WordPressVIPMinimum/Sniffs/JS/HTMLExecutingFunctionsSniff.php b/WordPressVIPMinimum/Sniffs/JS/HTMLExecutingFunctionsSniff.php index 373833ca..9188752b 100644 --- a/WordPressVIPMinimum/Sniffs/JS/HTMLExecutingFunctionsSniff.php +++ b/WordPressVIPMinimum/Sniffs/JS/HTMLExecutingFunctionsSniff.php @@ -24,7 +24,7 @@ class HTMLExecutingFunctionsSniff extends Sniff { * Value indicates whether the function's arg is the content to be inserted, or the target where the inserted * content is to be inserted before/after/replaced. For the latter, the content is in the preceding method's arg. * - * @var array + * @var array */ public $HTMLExecutingFunctions = [ 'after' => 'content', // jQuery. diff --git a/WordPressVIPMinimum/Sniffs/JS/StringConcatSniff.php b/WordPressVIPMinimum/Sniffs/JS/StringConcatSniff.php index 17eb4445..56902d07 100644 --- a/WordPressVIPMinimum/Sniffs/JS/StringConcatSniff.php +++ b/WordPressVIPMinimum/Sniffs/JS/StringConcatSniff.php @@ -63,8 +63,8 @@ public function process_token( $stackPtr ) { /** * Consolidated violation. * - * @param int $stackPtr The position of the current token in the stack passed in $tokens. - * @param array $data Replacements for the error message. + * @param int $stackPtr The position of the current token in the stack passed in $tokens. + * @param array $data Replacements for the error message. * * @return void */ diff --git a/WordPressVIPMinimum/Sniffs/JS/WindowSniff.php b/WordPressVIPMinimum/Sniffs/JS/WindowSniff.php index 3e292dfa..dc69d0b6 100644 --- a/WordPressVIPMinimum/Sniffs/JS/WindowSniff.php +++ b/WordPressVIPMinimum/Sniffs/JS/WindowSniff.php @@ -38,7 +38,7 @@ public function register() { /** * List of window properties that need to be flagged. * - * @var array + * @var array> */ private $windowProperties = [ 'location' => [ diff --git a/WordPressVIPMinimum/Sniffs/Performance/LowExpiryCacheTimeSniff.php b/WordPressVIPMinimum/Sniffs/Performance/LowExpiryCacheTimeSniff.php index 105b38ac..aa5a42db 100644 --- a/WordPressVIPMinimum/Sniffs/Performance/LowExpiryCacheTimeSniff.php +++ b/WordPressVIPMinimum/Sniffs/Performance/LowExpiryCacheTimeSniff.php @@ -41,7 +41,7 @@ class LowExpiryCacheTimeSniff extends AbstractFunctionParameterSniff { /** * List of WP time constants, see https://codex.wordpress.org/Easier_Expression_of_Time_Constants. * - * @var array + * @var array */ protected $wp_time_constants = [ 'MINUTE_IN_SECONDS' => 60, diff --git a/WordPressVIPMinimum/Sniffs/Performance/TaxonomyMetaInOptionsSniff.php b/WordPressVIPMinimum/Sniffs/Performance/TaxonomyMetaInOptionsSniff.php index a2c50420..e5adb2a7 100644 --- a/WordPressVIPMinimum/Sniffs/Performance/TaxonomyMetaInOptionsSniff.php +++ b/WordPressVIPMinimum/Sniffs/Performance/TaxonomyMetaInOptionsSniff.php @@ -19,7 +19,7 @@ class TaxonomyMetaInOptionsSniff extends Sniff { /** * List of options_ functions * - * @var array + * @var array */ public $option_functions = [ 'get_option', @@ -31,7 +31,7 @@ class TaxonomyMetaInOptionsSniff extends Sniff { /** * List of possible variable names holding term ID. * - * @var array + * @var array */ public $taxonomy_term_patterns = [ 'category_id', diff --git a/WordPressVIPMinimum/Sniffs/Security/PHPFilterFunctionsSniff.php b/WordPressVIPMinimum/Sniffs/Security/PHPFilterFunctionsSniff.php index 34c73014..739145c6 100644 --- a/WordPressVIPMinimum/Sniffs/Security/PHPFilterFunctionsSniff.php +++ b/WordPressVIPMinimum/Sniffs/Security/PHPFilterFunctionsSniff.php @@ -38,7 +38,7 @@ class PHPFilterFunctionsSniff extends AbstractFunctionParameterSniff { /** * List of restricted filter names. * - * @var array + * @var array */ private $restricted_filters = [ 'FILTER_DEFAULT' => true, diff --git a/WordPressVIPMinimum/Sniffs/Security/ProperEscapingFunctionSniff.php b/WordPressVIPMinimum/Sniffs/Security/ProperEscapingFunctionSniff.php index 1a9e9334..fcb4d1b3 100644 --- a/WordPressVIPMinimum/Sniffs/Security/ProperEscapingFunctionSniff.php +++ b/WordPressVIPMinimum/Sniffs/Security/ProperEscapingFunctionSniff.php @@ -28,7 +28,7 @@ class ProperEscapingFunctionSniff extends Sniff { /** * List of escaping functions which are being tested. * - * @var array + * @var array */ protected $escaping_functions = [ 'esc_url' => 'url', @@ -45,7 +45,7 @@ class ProperEscapingFunctionSniff extends Sniff { /** * List of tokens we can skip. * - * @var array + * @var array */ private $echo_or_concat_tokens = [ @@ -63,7 +63,7 @@ class ProperEscapingFunctionSniff extends Sniff { * for public methods which extending sniffs may be * relying on. * - * @var array + * @var array */ private $url_attrs = [ 'href', @@ -79,7 +79,7 @@ class ProperEscapingFunctionSniff extends Sniff { * for public methods which extending sniffs may be * relying on. * - * @var array + * @var array */ private $attr_endings = [ '=', diff --git a/WordPressVIPMinimum/Sniffs/UserExperience/AdminBarRemovalSniff.php b/WordPressVIPMinimum/Sniffs/UserExperience/AdminBarRemovalSniff.php index 51b69d80..4d5c74ac 100644 --- a/WordPressVIPMinimum/Sniffs/UserExperience/AdminBarRemovalSniff.php +++ b/WordPressVIPMinimum/Sniffs/UserExperience/AdminBarRemovalSniff.php @@ -26,7 +26,7 @@ class AdminBarRemovalSniff extends AbstractFunctionParameterSniff { /** * A list of tokenizers this sniff supports. * - * @var array + * @var array */ public $supportedTokenizers = [ 'PHP', @@ -58,7 +58,7 @@ class AdminBarRemovalSniff extends AbstractFunctionParameterSniff { /** * CSS properties this sniff is looking for. * - * @var array + * @var array> */ protected $target_css_properties = [ 'visibility' => [ @@ -78,7 +78,7 @@ class AdminBarRemovalSniff extends AbstractFunctionParameterSniff { /** * CSS selectors this sniff is looking for. * - * @var array + * @var array */ protected $target_css_selectors = [ '.show-admin-bar', @@ -90,7 +90,7 @@ class AdminBarRemovalSniff extends AbstractFunctionParameterSniff { * * Set from the register() method. * - * @var array + * @var array */ private $string_tokens = []; diff --git a/WordPressVIPMinimum/Sniffs/Variables/ServerVariablesSniff.php b/WordPressVIPMinimum/Sniffs/Variables/ServerVariablesSniff.php index 47ce66ec..c069febb 100644 --- a/WordPressVIPMinimum/Sniffs/Variables/ServerVariablesSniff.php +++ b/WordPressVIPMinimum/Sniffs/Variables/ServerVariablesSniff.php @@ -18,7 +18,7 @@ class ServerVariablesSniff extends Sniff { /** * List of restricted constant names. * - * @var array + * @var array> */ public $restrictedVariables = [ 'authVariables' => [ diff --git a/tests/RulesetTest.php b/tests/RulesetTest.php index 6c92e731..38b8aafc 100644 --- a/tests/RulesetTest.php +++ b/tests/RulesetTest.php @@ -28,7 +28,7 @@ class RulesetTest { * * This is the giant array in the ruleset-test.php files. * - * @var array + * @var array>> */ public $expected = []; @@ -82,8 +82,8 @@ class RulesetTest { /** * Init the object by processing the test file. * - * @param string $ruleset Name of the ruleset e.g. WordPressVIPMinimum or WordPress-VIP-Go. - * @param array $expected The array of expected errors, warnings and messages. + * @param string $ruleset Name of the ruleset e.g. WordPressVIPMinimum or WordPress-VIP-Go. + * @param array>> $expected The array of expected errors, warnings and messages. */ public function __construct( $ruleset, $expected = [] ) { $this->ruleset = $ruleset;