|
2 | 2 | <ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="phpMyAdmin coding standard" xsi:noNamespaceSchemaLocation="../vendor/squizlabs/php_codesniffer/phpcs.xsd">
|
3 | 3 | <description>The phpMyAdmin coding standard.</description>
|
4 | 4 |
|
| 5 | + <!-- Import Doctrine coding standard (base) --> |
5 | 6 | <rule ref="Doctrine">
|
6 |
| - <!-- Do not add a space before the return type colon --> |
7 |
| - <!-- See SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing --> |
8 |
| - <properties> |
9 |
| - <property name="spacesCountBeforeColon" value="0"/> |
10 |
| - </properties> |
11 |
| - |
12 | 7 | <!-- Do not require multiple assignment alignment -->
|
13 | 8 | <exclude name="Generic.Formatting.MultipleStatementAlignment"/>
|
14 | 9 |
|
|
21 | 16 | <exclude name="SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming"/>
|
22 | 17 | <exclude name="SlevomatCodingStandard.Classes.SuperfluousTraitNaming"/>
|
23 | 18 |
|
24 |
| - <!-- Exclude some new rules until we decide we adopt them --> |
25 |
| - <exclude name="SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing.IncorrectLinesCountAfterControlStructure"/> |
26 |
| - <exclude name="SlevomatCodingStandard.Namespaces.UseSpacing.IncorrectLinesCountBetweenDifferentTypeOfUse"/> |
27 |
| - <exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint"/> |
28 |
| - <exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint"/> |
29 |
| - <exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint"/> |
30 |
| - <exclude name="Squiz.NamingConventions.ValidVariableName.NotCamelCaps"/> |
31 |
| - <exclude name="Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps"/> |
32 |
| - <exclude name="SlevomatCodingStandard.PHP.RequireExplicitAssertion.RequiredExplicitAssertion"/> |
33 |
| - <exclude name="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses"/> |
34 |
| - <exclude name="PSR12.ControlStructures.ControlStructureSpacing.FirstExpressionLine"/> |
35 |
| - <exclude name="PSR12.ControlStructures.ControlStructureSpacing.CloseParenthesisLine"/> |
36 |
| - <exclude name="SlevomatCodingStandard.ControlStructures.JumpStatementsSpacing.IncorrectLinesCountAfterLastControlStructure"/> |
37 |
| - <exclude name="SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing.IncorrectLinesCountAfterLastControlStructure"/> |
38 |
| - <exclude name="PSR12.ControlStructures.ControlStructureSpacing.LineIndent"/> |
39 |
| - <exclude name="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceEqualOperator.RequiredNullCoalesceEqualOperator"/> |
40 |
| - <exclude name="SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration.MissingVariable"/> |
41 |
| - <exclude name="SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration.NoAssignment"/> |
| 19 | + <!-- Do not replace /* @var type $foo */ and similar simple inline annotations with assert() --> |
| 20 | + <exclude name="SlevomatCodingStandard.PHP.RequireExplicitAssertion"/> |
42 | 21 | </rule>
|
43 |
| - <rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification"> |
44 |
| - <severity>4</severity> |
| 22 | + |
| 23 | + <!-- Disable modern class name reference on objects (PHP 8.0+) --> |
| 24 | + <rule ref="SlevomatCodingStandard.Classes.ModernClassNameReference"> |
| 25 | + <properties> |
| 26 | + <property name="enableOnObjects" value="false"/> |
| 27 | + </properties> |
45 | 28 | </rule>
|
46 |
| - <rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification"> |
47 |
| - <severity>4</severity> |
| 29 | + |
| 30 | + <!-- Do not require usage of null coalesce operator equal operator (PHP 7.4+) --> |
| 31 | + <rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceEqualOperator"> |
| 32 | + <properties> |
| 33 | + <property name="enable" value="false"/> |
| 34 | + </properties> |
48 | 35 | </rule>
|
49 |
| - <rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingTraversableTypeHintSpecification"> |
50 |
| - <severity>4</severity> |
| 36 | + |
| 37 | + <!-- Disable native type hints for properties (PHP 7.4+) --> |
| 38 | + <rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint"> |
| 39 | + <properties> |
| 40 | + <property name="enableNativeTypeHint" value="false"/> |
| 41 | + </properties> |
51 | 42 | </rule>
|
52 | 43 | </ruleset>
|
0 commit comments