|
| 1 | +<?xml version="1.0"?> |
| 2 | +<ruleset |
| 3 | + name="Respect Coding Standard" |
| 4 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 5 | + xsi:noNamespaceSchemaLocation="../../vendor/squizlabs/php_codesniffer/phpcs.xsd"> |
| 6 | + |
| 7 | + <description>A set of PHP_CodeSniffer rules applied the Respect components.</description> |
| 8 | + |
| 9 | + <rule ref="PSR1" /> |
| 10 | + <rule ref="PSR2" /> |
| 11 | + <rule ref="Generic.Arrays.ArrayIndent" /> |
| 12 | + <rule ref="Generic.Arrays.DisallowLongArraySyntax" /> |
| 13 | + <rule ref="Generic.Formatting.SpaceAfterNot"> |
| 14 | + <properties> |
| 15 | + <property name="spacing" value="0" /> |
| 16 | + </properties> |
| 17 | + </rule> |
| 18 | + <rule ref="Generic.NamingConventions.CamelCapsFunctionName" /> |
| 19 | + <rule ref="Generic.PHP.NoSilencedErrors" /> |
| 20 | + <rule ref="Generic.Strings.UnnecessaryStringConcat"> |
| 21 | + <properties> |
| 22 | + <property name="allowMultiline" value="true" /> |
| 23 | + </properties> |
| 24 | + </rule> |
| 25 | + <rule ref="Generic.WhiteSpace.ArbitraryParenthesesSpacing" /> |
| 26 | + <rule ref="Generic.WhiteSpace.IncrementDecrementSpacing" /> |
| 27 | + <rule ref="PEAR.WhiteSpace.ObjectOperatorIndent" /> |
| 28 | + <rule ref="SlevomatCodingStandard.Arrays.DisallowImplicitArrayCreation" /> |
| 29 | + <rule ref="SlevomatCodingStandard.Arrays.TrailingArrayComma" /> |
| 30 | + <rule ref="SlevomatCodingStandard.Classes.ClassConstantVisibility" /> |
| 31 | + <rule ref="SlevomatCodingStandard.Classes.DisallowLateStaticBindingForConstants" /> |
| 32 | + <rule ref="SlevomatCodingStandard.Classes.ModernClassNameReference" /> |
| 33 | + <rule ref="SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming" /> |
| 34 | + <rule ref="SlevomatCodingStandard.Classes.SuperfluousTraitNaming" /> |
| 35 | + <rule ref="SlevomatCodingStandard.Classes.TraitUseDeclaration" /> |
| 36 | + <rule ref="SlevomatCodingStandard.Classes.TraitUseSpacing"> |
| 37 | + <properties> |
| 38 | + <property name="linesCountBeforeFirstUse" value="0" /> |
| 39 | + </properties> |
| 40 | + </rule> |
| 41 | + <rule ref="SlevomatCodingStandard.ControlStructures.AssignmentInCondition" /> |
| 42 | + <rule ref="SlevomatCodingStandard.ControlStructures.ControlStructureSpacing"> |
| 43 | + <properties> |
| 44 | + <property name="tokensToCheck" type="array"> |
| 45 | + <element value="T_RETURN" /> |
| 46 | + </property> |
| 47 | + </properties> |
| 48 | + </rule> |
| 49 | + <rule ref="SlevomatCodingStandard.ControlStructures.DisallowContinueWithoutIntegerOperandInSwitch" /> |
| 50 | + <rule ref="SlevomatCodingStandard.ControlStructures.DisallowYodaComparison" /> |
| 51 | + <rule ref="SlevomatCodingStandard.ControlStructures.EarlyExit" /> |
| 52 | + <rule ref="SlevomatCodingStandard.ControlStructures.LanguageConstructWithParentheses" /> |
| 53 | + <rule ref="SlevomatCodingStandard.ControlStructures.NewWithParentheses" /> |
| 54 | + <rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator" /> |
| 55 | + <rule ref="SlevomatCodingStandard.ControlStructures.RequireShortTernaryOperator" /> |
| 56 | + <rule ref="SlevomatCodingStandard.ControlStructures.RequireTernaryOperator" /> |
| 57 | + <rule ref="SlevomatCodingStandard.ControlStructures.UselessIfConditionWithReturn" /> |
| 58 | + <rule ref="SlevomatCodingStandard.ControlStructures.UselessTernaryOperator" /> |
| 59 | + <rule ref="SlevomatCodingStandard.Exceptions.DeadCatch" /> |
| 60 | + <rule ref="SlevomatCodingStandard.Exceptions.ReferenceThrowableOnly" /> |
| 61 | + <rule ref="SlevomatCodingStandard.Functions.StaticClosure" /> |
| 62 | + <rule ref="SlevomatCodingStandard.Functions.UselessParameterDefaultValue" /> |
| 63 | + <rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses" /> |
| 64 | + <rule ref="SlevomatCodingStandard.Namespaces.DisallowGroupUse" /> |
| 65 | + <rule ref="SlevomatCodingStandard.Namespaces.NamespaceDeclaration" /> |
| 66 | + <rule ref="SlevomatCodingStandard.Namespaces.NamespaceSpacing" /> |
| 67 | + <rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly"> |
| 68 | + <properties> |
| 69 | + <property name="allowFallbackGlobalConstants" value="false"/> |
| 70 | + <property name="allowFallbackGlobalFunctions" value="false"/> |
| 71 | + <property name="allowFullyQualifiedGlobalClasses" value="false"/> |
| 72 | + <property name="allowFullyQualifiedGlobalConstants" value="false"/> |
| 73 | + <property name="allowFullyQualifiedGlobalFunctions" value="false"/> |
| 74 | + <property name="allowFullyQualifiedNameForCollidingClasses" value="true"/> |
| 75 | + <property name="allowFullyQualifiedNameForCollidingConstants" value="true"/> |
| 76 | + <property name="allowFullyQualifiedNameForCollidingFunctions" value="true"/> |
| 77 | + <property name="searchAnnotations" value="true"/> |
| 78 | + </properties> |
| 79 | + </rule> |
| 80 | + <rule ref="SlevomatCodingStandard.Namespaces.RequireOneNamespaceInFile" /> |
| 81 | + <rule ref="SlevomatCodingStandard.Namespaces.UnusedUses"> |
| 82 | + <properties> |
| 83 | + <property name="searchAnnotations" value="true" /> |
| 84 | + </properties> |
| 85 | + </rule> |
| 86 | + <rule ref="SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash" /> |
| 87 | + <rule ref="SlevomatCodingStandard.Namespaces.UseFromSameNamespace" /> |
| 88 | + <rule ref="SlevomatCodingStandard.Namespaces.UselessAlias" /> |
| 89 | + <rule ref="SlevomatCodingStandard.Namespaces.UseSpacing" /> |
| 90 | + <rule ref="SlevomatCodingStandard.PHP.OptimizedFunctionsWithoutUnpacking" /> |
| 91 | + <rule ref="SlevomatCodingStandard.PHP.ShortList" /> |
| 92 | + <rule ref="SlevomatCodingStandard.PHP.TypeCast" /> |
| 93 | + <rule ref="SlevomatCodingStandard.PHP.UselessParentheses" /> |
| 94 | + <rule ref="SlevomatCodingStandard.PHP.UselessSemicolon" /> |
| 95 | + <rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing" /> |
| 96 | + <rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing" /> |
| 97 | + <rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes"> |
| 98 | + <properties> |
| 99 | + <property name="newlinesCountBetweenOpenTagAndDeclare" value="2" /> |
| 100 | + <property name="spacesCountAroundEqualsSign" value="0" /> |
| 101 | + </properties> |
| 102 | + </rule> |
| 103 | + <rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue" /> |
| 104 | + <rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration"> |
| 105 | + <properties> |
| 106 | + <property name="allAnnotationsAreUseful" value="true" /> |
| 107 | + <property name="enableEachParameterAndReturnInspection" value="true" /> |
| 108 | + </properties> |
| 109 | + </rule> |
| 110 | + <rule ref="SlevomatCodingStandard.TypeHints.UselessConstantTypeHint" /> |
| 111 | + <rule ref="SlevomatCodingStandard.Variables.DuplicateAssignmentToVariable" /> |
| 112 | + <rule ref="SlevomatCodingStandard.Variables.UnusedVariable" /> |
| 113 | + <rule ref="SlevomatCodingStandard.Variables.UselessVariable" /> |
| 114 | + <rule ref="Squiz.PHP.CommentedOutCode" /> |
| 115 | + <rule ref="Squiz.WhiteSpace.FunctionSpacing"> |
| 116 | + <properties> |
| 117 | + <property name="spacing" value="1" /> |
| 118 | + <property name="spacingBeforeFirst" value="0" /> |
| 119 | + <property name="spacingAfterLast" value="0" /> |
| 120 | + </properties> |
| 121 | + </rule> |
| 122 | + <rule ref="Squiz.Strings.ConcatenationSpacing"> |
| 123 | + <properties> |
| 124 | + <property name="spacing" value="0" /> |
| 125 | + <property name="ignoreNewlines" value="true" /> |
| 126 | + </properties> |
| 127 | + </rule> |
| 128 | + <rule ref="Squiz.Strings.DoubleQuoteUsage"/> |
| 129 | + <rule ref="Squiz.Strings.DoubleQuoteUsage.ContainsVar"> |
| 130 | + <message>Variable "%s" not allowed in double quoted string; use sprintf() or concatenation instead</message> |
| 131 | + </rule> |
| 132 | + <rule ref="Squiz.WhiteSpace.MemberVarSpacing"> |
| 133 | + <properties> |
| 134 | + <property name="spacing" value="1" /> |
| 135 | + <property name="spacingBeforeFirst" value="0" /> |
| 136 | + </properties> |
| 137 | + </rule> |
| 138 | + <rule ref="Squiz.WhiteSpace.LanguageConstructSpacing" /> |
| 139 | + <rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing" /> |
| 140 | + <rule ref="Squiz.WhiteSpace.ObjectOperatorSpacing"> |
| 141 | + <properties> |
| 142 | + <property name="ignoreNewlines" value="true" /> |
| 143 | + </properties> |
| 144 | + </rule> |
| 145 | + <rule ref="Squiz.WhiteSpace.OperatorSpacing" /> |
| 146 | + <rule ref="Squiz.WhiteSpace.SemicolonSpacing" /> |
| 147 | + <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"> |
| 148 | + <properties> |
| 149 | + <property name="ignoreBlankLines" value="false" /> |
| 150 | + </properties> |
| 151 | + </rule> |
| 152 | + <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines"> |
| 153 | + <severity>5</severity> |
| 154 | + </rule> |
| 155 | + <rule ref="Symfony.Functions.ScopeOrder" /> |
| 156 | +</ruleset> |
0 commit comments