|
18 | 18 | <arg value="sp"/> |
19 | 19 |
|
20 | 20 | <!-- |
21 | | - PSR 2 Code style. |
22 | | - See http://www.php-fig.org/psr/psr-2/ |
| 21 | + PSR 12 Code style. |
| 22 | + See http://www.php-fig.org/psr/psr-12/ |
23 | 23 | --> |
24 | | - <rule ref="PSR2"> |
| 24 | + <rule ref="PSR12"> |
25 | 25 | <exclude name="Generic.Files.LineLength.TooLong"/> |
26 | 26 | </rule> |
27 | 27 |
|
28 | 28 | <!-- |
29 | 29 | Neutron standard are quality tools for PHP7 development from Automattic. |
30 | 30 | See https://github.com/Automattic/phpcs-neutron-standard |
31 | 31 | --> |
32 | | - <rule ref="NeutronStandard.Arrays.DisallowLongformArray"> |
33 | | - <type>warning</type> |
34 | | - </rule> |
35 | 32 | <rule ref="NeutronStandard.AssignAlign.DisallowAssignAlign"> |
36 | 33 | <type>warning</type> |
37 | 34 | </rule> |
38 | | - <rule ref="NeutronStandard.Extract.DisallowExtract"> |
39 | | - <type>warning</type> |
40 | | - </rule> |
41 | 35 | <rule ref="NeutronStandard.Functions.DisallowCallUserFunc"> |
42 | 36 | <type>warning</type> |
43 | 37 | </rule> |
|
58 | 52 | </rule> |
59 | 53 |
|
60 | 54 | <!-- |
61 | | - Some WordPress specific rules. |
| 55 | + Curated list of WordPress specific rules. |
62 | 56 | See https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards |
63 | 57 | --> |
64 | | - <rule ref="WordPress.VIP.SessionVariableUsage"/> |
65 | | - <rule ref="WordPress.VIP.SessionFunctionsUsage"/> |
66 | | - <rule ref="WordPress.VIP.SuperGlobalInputUsage"/> |
67 | | - <rule ref="WordPress.VIP.ValidatedSanitizedInput"/> |
68 | | - <rule ref="WordPress.XSS.EscapeOutput"/> |
69 | | - <rule ref="WordPress.CSRF.NonceVerification"/> |
70 | | - <rule ref="WordPress.WP.AlternativeFunctions.curl"/> |
71 | | - <rule ref="WordPress.WP.DiscouragedConstants"/> |
72 | | - <rule ref="WordPress.WP.I18n"/> |
73 | 58 | <rule ref="WordPress.Arrays.CommaAfterArrayItem"/> |
74 | | - <rule ref="WordPress.PHP.StrictComparisons"/> |
75 | | - <rule ref="WordPress.PHP.StrictInArray"/> |
76 | | - <rule ref="WordPress.PHP.POSIXFunctions"/> |
| 59 | + <rule ref="WordPress.CodeAnalysis.AssignmentInCondition"/> |
| 60 | + <rule ref="WordPress.CodeAnalysis.EmptyStatement"/> |
| 61 | + <rule ref="WordPress.CodeAnalysis.EscapedNotTranslated"/> |
| 62 | + <rule ref="WordPress.DB.PreparedSQLPlaceholders"/> |
| 63 | + <rule ref="WordPress.DB.PreparedSQL"/> |
| 64 | + <rule ref="WordPress.DB.RestrictedClasses"/> |
| 65 | + <rule ref="WordPress.DB.RestrictedFunctions"/> |
| 66 | + <rule ref="WordPress.DateTime.CurrentTimeTimestamp"/> |
| 67 | + <rule ref="WordPress.DateTime.RestrictedFunctions"/> |
| 68 | + <rule ref="WordPress.NamingConventions.PrefixAllGlobals"/> |
| 69 | + <rule ref="WordPress.NamingConventions.ValidHookName"> |
| 70 | + <properties> |
| 71 | + <property name="additionalWordDelimiters" value="-/."/> |
| 72 | + </properties> |
| 73 | + </rule> |
| 74 | + <rule ref="WordPress.NamingConventions.ValidPostTypeSlug"/> |
| 75 | + <rule ref="WordPress.PHP.DevelopmentFunctions"/> |
| 76 | + <rule ref="WordPress.PHP.DevelopmentFunctions.error_log"> |
| 77 | + <type>error</type> |
| 78 | + </rule> |
| 79 | + <rule ref="WordPress.PHP.DevelopmentFunctions.prevent_path_disclosure"> |
| 80 | + <type>error</type> |
| 81 | + </rule> |
77 | 82 | <rule ref="WordPress.PHP.RestrictedPHPFunctions"/> |
78 | 83 | <rule ref="WordPress.PHP.DiscouragedPHPFunctions"> |
79 | 84 | <properties> |
|
85 | 90 | <rule ref="WordPress.PHP.DiscouragedPHPFunctions.runtime_configuration"> |
86 | 91 | <type>error</type> |
87 | 92 | </rule> |
88 | | - <rule ref="WordPress.PHP.DevelopmentFunctions"/> |
89 | | - <rule ref="WordPress.PHP.DevelopmentFunctions.error_log"> |
90 | | - <type>error</type> |
91 | | - </rule> |
92 | | - <rule ref="WordPress.PHP.DevelopmentFunctions.prevent_path_disclosure"> |
93 | | - <type>error</type> |
94 | | - </rule> |
| 93 | + <rule ref="WordPress.PHP.DontExtract"/> |
| 94 | + <rule ref="WordPress.PHP.IniSet"/> |
| 95 | + <rule ref="WordPress.PHP.NoSilencedErrors"/> |
| 96 | + <rule ref="WordPress.PHP.POSIXFunctions"/> |
| 97 | + <rule ref="WordPress.PHP.PregQuoteDelimiter"/> |
| 98 | + <rule ref="WordPress.PHP.RestrictedPHPFunctions"/> |
| 99 | + <rule ref="WordPress.PHP.StrictComparisons"/> |
| 100 | + <rule ref="WordPress.PHP.StrictInArray"/> |
| 101 | + <rule ref="WordPress.PHP.TypeCasts"/> |
| 102 | + <rule ref="WordPress.Security.EscapeOutput"/> |
| 103 | + <rule ref="WordPress.Security.NonceVerification"/> |
| 104 | + <rule ref="WordPress.Security.PluginMenuSlug"/> |
| 105 | + <rule ref="WordPress.Security.SafeRedirect"/> |
| 106 | + <rule ref="WordPress.Security.ValidatedSanitizedInput"/> |
| 107 | + <rule ref="WordPress.WP.AlternativeFunctions.curl"/> |
| 108 | + <rule ref="WordPress.WP.AlternativeFunctions.file_get_contents"/> |
| 109 | + <rule ref="WordPress.WP.AlternativeFunctions.file_system_read"/> |
| 110 | + <rule ref="WordPress.WP.AlternativeFunctions.strip_tags"/> |
| 111 | + <rule ref="WordPress.WP.AlternativeFunctions.rand_seeding"/> |
| 112 | + <rule ref="WordPress.WP.AlternativeFunctions.rand"/> |
| 113 | + <rule ref="WordPress.WP.CapitalPDangit"/> |
| 114 | + <rule ref="WordPress.WP.DeprecatedClasses"/> |
| 115 | + <rule ref="WordPress.WP.DeprecatedFunctions"/> |
| 116 | + <rule ref="WordPress.WP.DeprecatedParameters"/> |
| 117 | + <rule ref="WordPress.WP.DeprecatedParameterValues"/> |
| 118 | + <rule ref="WordPress.WP.DiscouragedConstants"/> |
| 119 | + <rule ref="WordPress.WP.DiscouragedFunctions"/> |
| 120 | + <rule ref="WordPress.WP.EnqueuedResourceParameters"/> |
| 121 | + <rule ref="WordPress.WP.EnqueuedResources"/> |
| 122 | + <rule ref="WordPress.WP.GlobalVariablesOverride"/> |
| 123 | + <rule ref="WordPress.WP.I18n"/> |
| 124 | + <rule ref="WordPress.WhiteSpace.CastStructureSpacing"/> |
| 125 | + |
| 126 | + <!-- |
| 127 | + Curated list of WordPress VIP rules. |
| 128 | + See https://github.com/Automattic/VIP-Coding-Standards/ |
| 129 | + --> |
| 130 | + <rule ref="WordPressVIPMinimum.Classes.DeclarationCompatibility"/> |
| 131 | + <rule ref="WordPressVIPMinimum.Constants.IncludingNonPHPFile"/> |
| 132 | + <rule ref="WordPressVIPMinimum.Functions.DynamicCalls"/> |
| 133 | + <rule ref="WordPressVIPMinimum.Hooks.AlwaysReturnInFilter"/> |
| 134 | + <rule ref="WordPressVIPMinimum.Hooks.PreGetPosts"/> |
| 135 | + <rule ref="WordPressVIPMinimum.Performance.OrderByRand"/> |
| 136 | + <rule ref="WordPressVIPMinimum.Performance.RegexpCompare"/> |
| 137 | + <rule ref="WordPressVIPMinimum.Performance.TaxonomyMetaInOptions"/> |
| 138 | + <rule ref="WordPressVIPMinimum.Security.EscapingVoidReturnFunctions"/> |
| 139 | + <rule ref="WordPressVIPMinimum.Security.ExitAfterRedirect"/> |
| 140 | + <rule ref="WordPressVIPMinimum.Security.PHPFilterFunctions"/> |
| 141 | + <rule ref="WordPressVIPMinimum.Security.ProperEscapingFunction"/> |
| 142 | + <rule ref="WordPressVIPMinimum.Security.StaticStrreplace"/> |
| 143 | + <rule ref="WordPressVIPMinimum.Variables.RestrictedVariables.session"/> |
| 144 | + <rule ref="WordPressVIPMinimum.Variables.VariableAnalysis"/> |
| 145 | + <rule ref="WordPressVIPMinimum.VersionControl.MergeConflict"/> |
95 | 146 |
|
96 | 147 | <!-- |
97 | 148 | Generic |
98 | 149 | --> |
| 150 | + <rule ref="Generic.Arrays.DisallowLongArraySyntax"/> |
99 | 151 | <rule ref="Generic.Metrics.CyclomaticComplexity"> |
100 | 152 | <properties> |
101 | 153 | <property name="absoluteComplexity" value="50"/> |
|
0 commit comments