Changeset 7050
- Timestamp:
- 12/15/2019 11:52:57 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpcs.xml.dist
r7042 r7050 1 1 <?xml version="1.0"?> 2 <ruleset name="WordPress Coding Standards"> 3 <description>Apply WordPress Coding Standards to all Core files with scpecific bbPress exclusions</description> 4 5 <rule ref="WordPress-Core"/> 6 7 <arg name="extensions" value="php"/> 8 9 <!-- Strip the filepaths down to the relevant bit. --> 10 <arg name="basepath" value="./"/> 11 12 <!-- Check up to 20 files simultaneously. --> 13 <arg name="parallel" value="20"/> 14 15 <!-- Show sniff codes in all reports --> 16 <arg value="psv"/> 2 <ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 3 name="bbPress" 4 xsi:noNamespaceSchemaLocation="./vendor/squizlabs/php_codesniffer/phpcs.xsd"> 5 6 <description>Apply WordPress Coding Standards to all Core files with specific bbPress exclusions</description> 7 8 <!-- 9 ############################################################################# 10 COMMAND LINE ARGUMENTS 11 https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml 12 ############################################################################# 13 --> 17 14 18 15 <file>.</file> … … 31 28 32 29 <!-- Exclude the NBBC parser. See https://github.com/bbpress/nbbc --> 33 <exclude-pattern>/src/includes/admin/parser.php</exclude-pattern> 30 <exclude-pattern>/src/includes/admin/parser\.php$</exclude-pattern> 31 32 <arg name="extensions" value="php"/> 33 34 <!-- Strip the filepaths down to the relevant bit. --> 35 <arg name="basepath" value="./"/> 36 37 <!-- Check up to 20 files simultaneously. --> 38 <arg name="parallel" value="20"/> 39 40 <!-- Show progress, show the error codes for each message (source). --> 41 <arg value="ps"/> 42 43 44 <!-- 45 ############################################################################# 46 SET UP THE RULES TO USE 47 ############################################################################# 48 --> 34 49 35 50 <!-- bbPress follows only a subset of the WordPress Coding Standards Rules --> 36 37 38 <!-- Rules that require further review, reviewed --> 51 <rule ref="WordPress-Extra"> 52 <!-- Set the minimum supported WP version for all sniff which use it in one go. 53 Ref: https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#minimum-wp-version-to-check-for-usage-of-deprecated-functions-classes-and-function-parameters 54 --> 55 <properties> 56 <property name="minimum_supported_version" value="5.3"/> 57 </properties> 58 59 <!-- Set the custom test class whitelist for all sniffs which use it in one go. 60 Ref: https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#custom-unit-test-classes 61 --> 62 <property name="custom_test_class_whitelist" type="array"> 63 <element value="BBP_UnitTestCase"/> 64 </property> 65 66 </rule> 67 68 <!-- Check the code for PHP cross-version compatibility. --> 69 <config name="testVersion" value="5.6-"/> 70 <rule ref="PHPCompatibilityWP"/> 71 72 73 <!-- 74 ############################################################################# 75 SNIFF SPECIFIC CONFIGURATION 76 ############################################################################# 77 --> 78 79 <!-- Verify that all gettext calls use the correct text domain. --> 80 <rule ref="WordPress.WP.I18n"> 81 <properties> 82 <property name="text_domain" type="array"> 83 <element value="bbpress"/> 84 </property> 85 </properties> 86 </rule> 87 88 <!-- Verify that everything in the global namespace is prefixed. --> 89 <rule ref="WordPress.NamingConventions.PrefixAllGlobals"> 90 <properties> 91 <property name="prefixes" type="array" extend="true"> 92 <element value="bbp"/> 93 </property> 94 </properties> 95 </rule> 96 97 <rule ref="WordPress.Arrays.MultipleStatementAlignment"> 98 <properties> 99 <!-- No need to adjust alignment of large arrays when the item with the largest key is removed. --> 100 <property name="exact" value="false"/> 101 <!-- Don't align multi-line items if ALL items in the array are multi-line. --> 102 <property name="alignMultilineItems" value="!=100"/> 103 <!-- Array Assignment operator should always be on the same line as the array key. --> 104 <property name="ignoreNewlines" value="false"/> 105 </properties> 106 </rule> 107 108 <rule ref="WordPress.PHP.NoSilencedErrors"> 109 <properties> 110 <property name="use_default_whitelist" value="true"/> 111 </properties> 112 </rule> 113 114 115 <!-- 116 ############################################################################# 117 SELECTIVE EXCLUSIONS 118 Exclude specific files for specific sniffs and/or exclude sub-groups in sniffs. 119 ############################################################################# 120 --> 39 121 40 122 <rule ref="Generic.Formatting.MultipleStatementAlignment.IncorrectWarning"> … … 59 141 60 142 <rule ref="PEAR.NamingConventions.ValidClassName.StartWithCapital"> 61 <exclude-pattern>/src/bbpress .php</exclude-pattern>62 <exclude-pattern>/src/includes/admin/converters/bbPress1 .php</exclude-pattern>63 <exclude-pattern>/src/includes/admin/converters/e107v1 .php</exclude-pattern>64 <exclude-pattern>/src/includes/admin/converters/phpBB .php</exclude-pattern>65 <exclude-pattern>/src/includes/admin/converters/vBulletin .php</exclude-pattern>66 <exclude-pattern>/src/includes/admin/converters/vBulletin3 .php</exclude-pattern>143 <exclude-pattern>/src/bbpress\.php$</exclude-pattern> 144 <exclude-pattern>/src/includes/admin/converters/bbPress1\.php$</exclude-pattern> 145 <exclude-pattern>/src/includes/admin/converters/e107v1\.php$</exclude-pattern> 146 <exclude-pattern>/src/includes/admin/converters/phpBB\.php$</exclude-pattern> 147 <exclude-pattern>/src/includes/admin/converters/vBulletin\.php$</exclude-pattern> 148 <exclude-pattern>/src/includes/admin/converters/vBulletin3\.php$</exclude-pattern> 67 149 </rule> 68 150 … … 79 161 </rule> 80 162 163 164 <!-- 165 ############################################################################# 166 TEMPORARY ADJUSTMENTS 167 Adjustments which should be removed once the associated issues have been reviewed and resolved. 168 ############################################################################# 169 --> 170 81 171 <!-- Rules that require further review, partially reviewed --> 82 172 173 <rule ref="Generic.Formatting.DisallowMultipleStatements.SameLine"> 174 <exclude-pattern>/src/*</exclude-pattern> 175 </rule> 176 177 <rule ref="Generic.Formatting.SpaceAfterCast.TooMuchSpace"> 178 <exclude-pattern>/src/*</exclude-pattern> 179 </rule> 180 181 <rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie.ContentAfterBrace"> 182 <exclude-pattern>/src/*</exclude-pattern> 183 </rule> 184 185 <rule ref="Generic.WhiteSpace.ArbitraryParenthesesSpacing.SpaceBeforeClose"> 186 <exclude-pattern>/src/*</exclude-pattern> 187 </rule> 188 189 <rule ref="PEAR.Functions.FunctionCallSignature.Indent"> 190 <exclude-pattern>/src/*</exclude-pattern> 191 </rule> 192 193 <rule ref="PEAR.Functions.FunctionCallSignature.EmptyLine"> 194 <exclude-pattern>/src/*</exclude-pattern> 195 </rule> 196 197 <rule ref="PSR2.ControlStructures.SwitchDeclaration.BreakIndent"> 198 <exclude-pattern>/src/*</exclude-pattern> 199 </rule> 200 201 <!-- Rules that require further review, not yet reviewed --> 202 203 <rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedElseif"> 204 <exclude-pattern>/src/*</exclude-pattern> 205 </rule> 206 207 <rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedIf"> 208 <exclude-pattern>/src/*</exclude-pattern> 209 </rule> 210 211 <rule ref="Generic.CodeAnalysis.UselessOverridingMethod.Found"> 212 <exclude-pattern>/src/*</exclude-pattern> 213 </rule> 214 83 215 <rule ref="Generic.ControlStructures.InlineControlStructure.NotAllowed"> 84 216 <exclude-pattern>/src/*</exclude-pattern> 85 217 </rule> 86 218 87 <rule ref="Generic.Formatting.DisallowMultipleStatements.SameLine"> 88 <exclude-pattern>/src/*</exclude-pattern> 89 </rule> 90 91 <rule ref="Generic.Formatting.SpaceAfterCast.TooMuchSpace"> 92 <exclude-pattern>/src/*</exclude-pattern> 93 </rule> 94 95 <rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie.ContentAfterBrace"> 96 <exclude-pattern>/src/*</exclude-pattern> 97 </rule> 98 99 <rule ref="Generic.WhiteSpace.ArbitraryParenthesesSpacing.SpaceBeforeClose"> 100 <exclude-pattern>/src/*</exclude-pattern> 101 </rule> 102 103 <rule ref="PEAR.Functions.FunctionCallSignature.Indent"> 104 <exclude-pattern>/src/*</exclude-pattern> 105 </rule> 106 107 <rule ref="PEAR.Functions.FunctionCallSignature.EmptyLine"> 108 <exclude-pattern>/src/*</exclude-pattern> 109 </rule> 110 111 <rule ref="PSR2.ControlStructures.SwitchDeclaration.BreakIndent"> 112 <exclude-pattern>/src/*</exclude-pattern> 113 </rule> 114 115 <!-- Rules that require further review, not yet reviewed --> 219 <rule ref="Generic.Files.LineEndings.InvalidEOLChar"> 220 <exclude-pattern>/src/*</exclude-pattern> 221 </rule> 222 223 <rule ref="Generic.Files.OneObjectStructurePerFile.MultipleFound"> 224 <exclude-pattern>/src/*</exclude-pattern> 225 </rule> 226 227 <rule ref="PEAR.Files.IncludingFile.UseRequire"> 228 <exclude-pattern>/bbpress\.php$</exclude-pattern> 229 <exclude-pattern>/src/*</exclude-pattern> 230 </rule> 116 231 117 232 <rule ref="PEAR.Functions.FunctionCallSignature.CloseBracketLine"> … … 123 238 </rule> 124 239 240 <rule ref="PEAR.Functions.FunctionCallSignature.FirstArgumentPosition"> 241 <exclude-pattern>/src/*</exclude-pattern> 242 </rule> 243 125 244 <rule ref="PEAR.Functions.FunctionCallSignature.MultipleArguments"> 126 245 <exclude-pattern>/src/*</exclude-pattern> … … 139 258 </rule> 140 259 260 <rule ref="PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.Changed"> 261 <exclude-pattern>/src/*</exclude-pattern> 262 </rule> 263 264 <rule ref="PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.NeedsInspection"> 265 <exclude-pattern>/src/*</exclude-pattern> 266 </rule> 267 268 <rule ref="PHPCompatibility.Syntax.RemovedCurlyBraceArrayAccess.Found"> 269 <exclude-pattern>/src/*</exclude-pattern> 270 </rule> 271 272 <rule ref="PSR2.Classes.PropertyDeclaration.ScopeMissing"> 273 <exclude-pattern>/src/*</exclude-pattern> 274 </rule> 275 276 <rule ref="PSR2.Classes.PropertyDeclaration.Underscore"> 277 <exclude-pattern>/src/*</exclude-pattern> 278 </rule> 279 280 <rule ref="PSR2.Classes.PropertyDeclaration.VarUsed"> 281 <exclude-pattern>/src/*</exclude-pattern> 282 </rule> 283 141 284 <rule ref="PSR2.ControlStructures.ElseIfDeclaration.NotAllowed"> 142 285 <exclude-pattern>/src/*</exclude-pattern> … … 159 302 </rule> 160 303 304 <rule ref="PSR2.Methods.MethodDeclaration.Underscore"> 305 <exclude-pattern>/src/*</exclude-pattern> 306 </rule> 307 161 308 <rule ref="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace"> 162 309 <exclude-pattern>/src/*</exclude-pattern> … … 171 318 </rule> 172 319 320 <rule ref="Squiz.PHP.CommentedOutCode.Found"> 321 <exclude-pattern>/src/*</exclude-pattern> 322 </rule> 323 173 324 <rule ref="Squiz.PHP.DisallowMultipleAssignments.Found"> 174 325 <exclude-pattern>/src/*</exclude-pattern> … … 179 330 </rule> 180 331 332 <rule ref="Squiz.PHP.DisallowSizeFunctionsInLoops.Found"> 333 <exclude-pattern>/src/*</exclude-pattern> 334 </rule> 335 181 336 <rule ref="Squiz.PHP.EmbeddedPhp.ContentAfterEnd"> 182 337 <exclude-pattern>/src/*</exclude-pattern> … … 195 350 </rule> 196 351 352 <rule ref="Squiz.PHP.NonExecutableCode.Unreachable"> 353 <exclude-pattern>/src/*</exclude-pattern> 354 </rule> 355 356 <rule ref="Squiz.Scope.MethodScope.Missing"> 357 <exclude-pattern>/src/*</exclude-pattern> 358 </rule> 359 197 360 <rule ref="Squiz.Strings.ConcatenationSpacing.PaddingFound"> 198 361 <exclude-pattern>/src/*</exclude-pattern> … … 243 406 </rule> 244 407 408 <rule ref="WordPress.Arrays.ArrayKeySpacingRestrictions.TooMuchSpaceAfterKey"> 409 <exclude-pattern>/src/*</exclude-pattern> 410 </rule> 411 245 412 <rule ref="WordPress.Arrays.CommaAfterArrayItem.SpaceAfterComma"> 246 413 <exclude-pattern>/src/*</exclude-pattern> … … 251 418 </rule> 252 419 420 <rule ref="WordPress.Arrays.MultipleStatementAlignment.MultilineItemSpaceBeforeDoubleArrow"> 421 <exclude-pattern>/src/*</exclude-pattern> 422 </rule> 423 253 424 <rule ref="WordPress.Arrays.MultipleStatementAlignment.SpaceBeforeDoubleArrow"> 254 425 <exclude-pattern>/src/*</exclude-pattern> … … 267 438 </rule> 268 439 440 <rule ref="WordPress.DateTime.CurrentTimeTimestamp.Requested"> 441 <exclude-pattern>/src/*</exclude-pattern> 442 </rule> 443 444 <rule ref="WordPress.DateTime.RestrictedFunctions.date_date"> 445 <exclude-pattern>/src/*</exclude-pattern> 446 </rule> 447 269 448 <rule ref="WordPress.DB.PreparedSQL.InterpolatedNotPrepared"> 270 449 <exclude-pattern>/src/*</exclude-pattern> … … 283 462 </rule> 284 463 464 <rule ref="WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound"> 465 <exclude-pattern>/src/*</exclude-pattern> 466 </rule> 467 468 <rule ref="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound"> 469 <exclude-pattern>/src/*</exclude-pattern> 470 </rule> 471 472 <rule ref="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedConstantFound"> 473 <exclude-pattern>/src/*</exclude-pattern> 474 </rule> 475 476 <rule ref="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound"> 477 <exclude-pattern>/src/*</exclude-pattern> 478 </rule> 479 480 <rule ref="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound"> 481 <exclude-pattern>/src/*</exclude-pattern> 482 </rule> 483 484 <rule ref="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound"> 485 <exclude-pattern>/src/*</exclude-pattern> 486 </rule> 487 285 488 <rule ref="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid"> 286 489 <exclude-pattern>/src/*</exclude-pattern> … … 291 494 </rule> 292 495 496 <rule ref="WordPress.PHP.DiscouragedPHPFunctions.serialize_serialize"> 497 <exclude-pattern>/src/*</exclude-pattern> 498 </rule> 499 500 <rule ref="WordPress.PHP.DiscouragedPHPFunctions.serialize_unserialize"> 501 <exclude-pattern>/src/*</exclude-pattern> 502 </rule> 503 504 <rule ref="WordPress.PHP.DiscouragedPHPFunctions.urlencode_urlencode"> 505 <exclude-pattern>/src/*</exclude-pattern> 506 </rule> 507 508 <rule ref="WordPress.PHP.IniSet.Risky"> 509 <exclude-pattern>/src/*</exclude-pattern> 510 </rule> 511 293 512 <rule ref="WordPress.PHP.NoSilencedErrors.Discouraged"> 294 513 <exclude-pattern>/src/*</exclude-pattern> 295 514 </rule> 296 515 516 <rule ref="WordPress.PHP.PregQuoteDelimiter.Missing"> 517 <exclude-pattern>/src/*</exclude-pattern> 518 </rule> 519 297 520 <rule ref="WordPress.PHP.StrictComparisons.LooseComparison"> 298 521 <exclude-pattern>/src/*</exclude-pattern> … … 307 530 </rule> 308 531 532 <rule ref="WordPress.Security.EscapeOutput.OutputNotEscaped"> 533 <exclude-pattern>/src/*</exclude-pattern> 534 </rule> 535 536 <rule ref="WordPress.Security.EscapeOutput.UnsafePrintingFunction"> 537 <exclude-pattern>/src/*</exclude-pattern> 538 </rule> 539 540 <rule ref="WordPress.Security.NonceVerification.Missing"> 541 <exclude-pattern>/src/*</exclude-pattern> 542 </rule> 543 544 <rule ref="WordPress.Security.NonceVerification.Recommended"> 545 <exclude-pattern>/src/*</exclude-pattern> 546 </rule> 547 309 548 <rule ref="WordPress.WhiteSpace.ControlStructureSpacing.ExtraSpaceAfterCloseParenthesis"> 310 549 <exclude-pattern>/src/*</exclude-pattern> … … 347 586 </rule> 348 587 588 <rule ref="WordPress.WP.AlternativeFunctions.json_encode_json_encode"> 589 <exclude-pattern>/src/*</exclude-pattern> 590 </rule> 591 592 <rule ref="WordPress.WP.AlternativeFunctions.parse_url_parse_url"> 593 <exclude-pattern>/src/*</exclude-pattern> 594 </rule> 595 596 <rule ref="WordPress.WP.AlternativeFunctions.rand_mt_rand"> 597 <exclude-pattern>/src/*</exclude-pattern> 598 </rule> 599 600 <rule ref="WordPress.WP.AlternativeFunctions.strip_tags_strip_tags"> 601 <exclude-pattern>/src/*</exclude-pattern> 602 </rule> 603 604 <rule ref="WordPress.WP.DiscouragedFunctions.query_posts_query_posts"> 605 <exclude-pattern>/src/*</exclude-pattern> 606 </rule> 607 608 <rule ref="WordPress.WP.DiscouragedFunctions.wp_reset_query_wp_reset_query"> 609 <exclude-pattern>/src/*</exclude-pattern> 610 </rule> 611 612 <rule ref="WordPress.WP.EnqueuedResourceParameters.NotInFooter"> 613 <exclude-pattern>/src/*</exclude-pattern> 614 </rule> 615 616 <rule ref="WordPress.WP.GlobalVariablesOverride.Prohibited"> 617 <exclude-pattern>/src/*</exclude-pattern> 618 </rule> 619 349 620 <rule ref="WordPress.WP.I18n.LowLevelTranslationFunction"> 350 621 <exclude-pattern>/src/*</exclude-pattern> -
trunk/src/includes/admin/converters/Invision.php
r7014 r7050 542 542 private function to_char( $input ) { 543 543 $output = ''; 544 for ( $i = 0; $i < strlen( $input ); $i++ ) { 544 $length = strlen( $input ); 545 for ( $i = 0; $i < $length; $i++ ) { 545 546 $j = ord( $input[$i] ); 546 547 if ( ( $j >= 65 && $j <= 90 )
Note: See TracChangeset
for help on using the changeset viewer.