| 
 | 1 | +<?xml version="1.0"?>  | 
 | 2 | +<ruleset>  | 
 | 3 | +    <arg name="basepath" value="." />  | 
 | 4 | +    <arg name="extensions" value="php" />  | 
 | 5 | +    <arg name="parallel" value="80" />  | 
 | 6 | +    <arg name="cache" value=".phpcs-cache" />  | 
 | 7 | +    <arg name="colors" />  | 
 | 8 | + | 
 | 9 | +    <!-- Ignore warnings (n), show progress of the run (p), and show sniff names (s) -->  | 
 | 10 | +    <arg value="nps"/>  | 
 | 11 | + | 
 | 12 | +    <file>source</file>  | 
 | 13 | + | 
 | 14 | +    <!-- Target minimum supported PHP version -->  | 
 | 15 | +    <config name="php_version" value="80100"/>  | 
 | 16 | + | 
 | 17 | +    <!-- ****************************************** -->  | 
 | 18 | +    <!-- Import rules from doctrine/coding-standard -->  | 
 | 19 | +    <!-- ****************************************** -->  | 
 | 20 | +    <rule ref="Doctrine">  | 
 | 21 | +        <!-- ******************************************** -->  | 
 | 22 | +        <!-- Exclude sniffs we simply don't want for docs -->  | 
 | 23 | +        <!-- ******************************************** -->  | 
 | 24 | +        <exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace" />  | 
 | 25 | +        <exclude name="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly" />  | 
 | 26 | +        <exclude name="Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps" />  | 
 | 27 | +        <!-- Results in false positives with comments used to denote include blocks -->  | 
 | 28 | +        <exclude name="SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing.IncorrectLinesCountAfterControlStructure" />  | 
 | 29 | +        <exclude name="Squiz.Classes.ClassFileName.NoMatch" />  | 
 | 30 | +        <!-- Results in false positives with comments used to denote include blocks before functions -->  | 
 | 31 | +        <exclude name="Squiz.Commenting.FunctionComment.WrongStyle" />  | 
 | 32 | +        <!-- Results in false positives with comments used to denote include blocks after functions -->  | 
 | 33 | +        <exclude name="Squiz.WhiteSpace.FunctionSpacing.After" />  | 
 | 34 | +        <!-- The following three excludes allow for more compact single-item array declarations -->  | 
 | 35 | +        <exclude name="Squiz.Arrays.ArrayDeclaration.IndexNoNewline" />  | 
 | 36 | +        <exclude name="Generic.Arrays.ArrayIndent.CloseBraceNotNewLine" />  | 
 | 37 | +        <exclude name="Squiz.Arrays.ArrayDeclaration.CloseBraceNewLine" />  | 
 | 38 | + | 
 | 39 | +        <!-- *********************************** -->  | 
 | 40 | +        <!-- Exclude sniffs that cause BC breaks -->  | 
 | 41 | +        <!-- *********************************** -->  | 
 | 42 | +        <exclude name="SlevomatCodingStandard.Classes.SuperfluousAbstractClassNaming" />  | 
 | 43 | +        <exclude name="SlevomatCodingStandard.Classes.SuperfluousExceptionNaming" />  | 
 | 44 | +        <exclude name="SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming" />  | 
 | 45 | +        <exclude name="SlevomatCodingStandard.Classes.SuperfluousTraitNaming" />  | 
 | 46 | + | 
 | 47 | +        <!-- Can cause subtle BC breaks -->  | 
 | 48 | +        <exclude name="SlevomatCodingStandard.TypeHints.DeclareStrictTypes" />  | 
 | 49 | + | 
 | 50 | + | 
 | 51 | +        <!-- **************************************** -->  | 
 | 52 | +        <!-- Exclude sniffs that force unwanted style -->  | 
 | 53 | +        <!-- **************************************** -->  | 
 | 54 | +        <exclude name="Generic.Formatting.MultipleStatementAlignment" />  | 
 | 55 | +        <exclude name="Squiz.Commenting.FunctionComment.ThrowsNoFullStop" />  | 
 | 56 | +        <exclude name="SlevomatCodingStandard.TypeHints.UnionTypeHintFormat.DisallowedShortNullable" />  | 
 | 57 | + | 
 | 58 | +        <!-- Keep long typehints (for now) -->  | 
 | 59 | +        <exclude name="PSR12.Keywords.ShortFormTypeKeywords" />  | 
 | 60 | +        <exclude name="SlevomatCodingStandard.PHP.TypeCast.InvalidCastUsed" />  | 
 | 61 | +        <exclude name="SlevomatCodingStandard.TypeHints.LongTypeHints" />  | 
 | 62 | + | 
 | 63 | + | 
 | 64 | +        <!-- ************************************************ -->  | 
 | 65 | +        <!-- Exclude sniffs that may cause functional changes -->  | 
 | 66 | +        <!-- ************************************************ -->  | 
 | 67 | +        <exclude name="Generic.PHP.ForbiddenFunctions.FoundWithAlternative" />  | 
 | 68 | +        <exclude name="SlevomatCodingStandard.ControlStructures.DisallowYodaComparison" />  | 
 | 69 | +        <exclude name="SlevomatCodingStandard.ControlStructures.EarlyExit" />  | 
 | 70 | +        <exclude name="SlevomatCodingStandard.ControlStructures.UselessIfConditionWithReturn" />  | 
 | 71 | +        <exclude name="SlevomatCodingStandard.Functions.StaticClosure" />  | 
 | 72 | +        <exclude name="SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure" />  | 
 | 73 | +        <exclude name="SlevomatCodingStandard.Operators.DisallowEqualOperators" />  | 
 | 74 | + | 
 | 75 | + | 
 | 76 | +        <!-- ********************************************************* -->  | 
 | 77 | +        <!-- Exclude sniffs that cause a huge diff - enable separately -->  | 
 | 78 | +        <!-- ********************************************************* -->  | 
 | 79 | +        <exclude name="SlevomatCodingStandard.Commenting.DocCommentSpacing.IncorrectAnnotationsGroup" />  | 
 | 80 | + | 
 | 81 | + | 
 | 82 | +        <!-- ********************* -->  | 
 | 83 | +        <!-- Exclude broken sniffs -->  | 
 | 84 | +        <!-- ********************* -->  | 
 | 85 | + | 
 | 86 | +        <!-- Sniff currently broken when casting arrays, see https://github.com/squizlabs/PHP_CodeSniffer/issues/2937#issuecomment-615498860 -->  | 
 | 87 | +        <exclude name="Squiz.Arrays.ArrayDeclaration.ValueNoNewline" />  | 
 | 88 | + | 
 | 89 | +        <!-- Disable forbidden annotation sniff as excluding @api from the list doesn't work -->  | 
 | 90 | +        <exclude name="SlevomatCodingStandard.Commenting.ForbiddenAnnotations.AnnotationForbidden" />  | 
 | 91 | +    </rule>  | 
 | 92 | + | 
 | 93 | + | 
 | 94 | +    <!-- **************************************** -->  | 
 | 95 | +    <!-- Enable rules not enforced by Doctrine CS -->  | 
 | 96 | +    <!-- **************************************** -->  | 
 | 97 | + | 
 | 98 | +    <!-- Require arrow functions where possible -->  | 
 | 99 | +    <rule ref="SlevomatCodingStandard.Functions.RequireArrowFunction"/>  | 
 | 100 | + | 
 | 101 | + | 
 | 102 | +    <!-- ****************************************************** -->  | 
 | 103 | +    <!-- Don't require annotations to specify traversable types -->  | 
 | 104 | +    <!-- ****************************************************** -->  | 
 | 105 | +    <rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint">  | 
 | 106 | +        <exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification" />  | 
 | 107 | +    </rule>  | 
 | 108 | +    <rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint">  | 
 | 109 | +        <exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingTraversableTypeHintSpecification" />  | 
 | 110 | +    </rule>  | 
 | 111 | +    <rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint">  | 
 | 112 | +        <exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification" />  | 
 | 113 | +    </rule>  | 
 | 114 | + | 
 | 115 | +    <rule ref="Generic.Files.InlineHTML.Found">  | 
 | 116 | +        <exclude-pattern>source/includes/aws-lambda/index.php</exclude-pattern>  | 
 | 117 | +    </rule>  | 
 | 118 | + | 
 | 119 | +</ruleset>  | 
0 commit comments