Skip to content

Commit 49b5879

Browse files
committed
apply ruleset, bump slevomat dependency
1 parent 5bed01f commit 49b5879

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

coder_sniffer/Drupal/ruleset.xml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111

112112
<!-- PSR-2 sniffs -->
113113
<rule ref="PSR2.Classes.PropertyDeclaration">
114-
<!-- Already covered by Drupal.Classes.PropertyDeclaration.VarUsed. -->
114+
<!-- Already covered by Drupal.Classes.PropertyDeclaration.VarUsed. -->
115115
<exclude name="PSR2.Classes.PropertyDeclaration.VarUsed"/>
116116
</rule>
117117
<rule ref="PSR2.Namespaces.NamespaceDeclaration"/>
@@ -120,6 +120,22 @@
120120
<!-- SlevomatCodingStandard sniffs -->
121121
<rule ref="SlevomatCodingStandard.Classes.BackedEnumTypeSpacing"/>
122122
<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator"/>
123+
<!-- Allow global names with backslash like \Drupal. -->
124+
<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly">
125+
<properties>
126+
<property name="allowFullyQualifiedGlobalClasses" value="true"/>
127+
<property name="allowFullyQualifiedGlobalFunctions" value="true"/>
128+
<property name="allowFullyQualifiedGlobalConstants" value="true"/>
129+
<property name="allowFallbackGlobalFunctions" value="true"/>
130+
<property name="allowFallbackGlobalConstants" value="true"/>
131+
</properties>
132+
</rule>
133+
<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedName">
134+
<exclude-pattern>*.api.php</exclude-pattern>
135+
</rule>
136+
<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedNameWithoutNamespace">
137+
<severity>0</severity>
138+
</rule>
123139
<rule ref="SlevomatCodingStandard.PHP.ShortList"/>
124140
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
125141
<exclude name="SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing"/>

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"ext-mbstring": "*",
1919
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1 || ^1.0.0",
2020
"sirbrillig/phpcs-variable-analysis": "^2.11.7",
21-
"slevomat/coding-standard": "^8.11",
21+
"slevomat/coding-standard": "^8.15",
2222
"squizlabs/php_codesniffer": "^3.11.2",
2323
"symfony/yaml": ">=3.4.0"
2424
},

0 commit comments

Comments
 (0)