Skip to content

Commit 9806cae

Browse files
authored
tools(phpcs): remove conflicting TypeHint rules from PHPCS ruleset. (#15)
1 parent 7cf8bb6 commit 9806cae

File tree

1 file changed

+1
-46
lines changed

1 file changed

+1
-46
lines changed

phpcs.xml.dist

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
<exclude name="WordPressVIPMinimum.JS" />
6060
</rule>
6161
<rule ref="WordPress-Extra">
62+
<!-- @todo: Determine a strategy on namespacing/merging into core. -->
6263
<exclude name="WordPress.WP.I18n.MissingArgDomain" />
6364
<exclude name="WordPress.NamingConventions.PrefixAllGlobals" />
6465
<!-- Needed to typehint, see: https://github.com/WordPress/WordPress-Coding-Standards/issues/403 -->
@@ -166,52 +167,6 @@
166167
<rule ref="SlevomatCodingStandard.TypeHints.LongTypeHints" />
167168
<rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue" />
168169
<rule ref="SlevomatCodingStandard.TypeHints.NullTypeHintOnLastPosition" />
169-
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint">
170-
<properties>
171-
<property name="enableMixedTypeHint" value="false" /><!-- Only available in PHP 8.0+ -->
172-
<property name="enableUnionTypeHint" value="false" /><!-- Only available in PHP 8.0+ -->
173-
<property name="enableIntersectionTypeHint" value="false" /><!-- Only available in PHP 8.1+ -->
174-
<property name="enableStandaloneNullTrueFalseTypeHints" value="false" /><!-- Only available in
175-
PHP 8.2+ -->
176-
</properties>
177-
</rule>
178-
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint">
179-
<properties>
180-
<property name="enableNativeTypeHint" value="false" /><!-- Only available in PHP 7.4+ -->
181-
<property name="enableMixedTypeHint" value="false" /><!-- Only available in PHP 8.0+ -->
182-
<property name="enableUnionTypeHint" value="false" /><!-- Only available in PHP 8.0+ -->
183-
<property name="enableIntersectionTypeHint" value="false" /><!-- Only available in PHP 8.1+ -->
184-
<property name="enableStandaloneNullTrueFalseTypeHints" value="false" /><!-- Only available in
185-
PHP 8.2+ -->
186-
</properties>
187-
</rule>
188-
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint">
189-
<properties>
190-
<property name="enableStaticTypeHint" value="false" /><!-- Only available in PHP 8.0+ -->
191-
<property name="enableMixedTypeHint" value="false" /><!-- Only available in PHP 8.0+ -->
192-
<property name="enableUnionTypeHint" value="false" /><!-- Only available in PHP 8.0+ -->
193-
<property name="enableIntersectionTypeHint" value="false" /><!-- Only available in PHP 8.1+ -->
194-
<property name="enableNeverTypeHint" value="false" /><!-- Only available in PHP 8.1+ -->
195-
<property name="enableStandaloneNullTrueFalseTypeHints" value="false" /><!-- Only available in
196-
PHP 8.2+ -->
197-
</properties>
198-
</rule>
199-
200-
<!--
201-
Exclude REST controllers from type hint requirements.
202-
WordPress core's WP_REST_Controller doesn't have type hints on its methods.
203-
Adding type hints to our overridden methods causes fatal errors at runtime
204-
due to signature mismatch. We must match the parent class signatures exactly.
205-
-->
206-
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint">
207-
<exclude-pattern>includes/rest-api/endpoints/class-wp-rest-abilities-*-controller.php</exclude-pattern>
208-
</rule>
209-
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint">
210-
<exclude-pattern>includes/rest-api/endpoints/class-wp-rest-abilities-*-controller.php</exclude-pattern>
211-
</rule>
212-
<rule ref="Squiz.Commenting.FunctionComment.TypeHintMissing">
213-
<exclude-pattern>includes/rest-api/endpoints/class-wp-rest-abilities-*-controller.php</exclude-pattern>
214-
</rule>
215170

216171
<rule ref="SlevomatCodingStandard.Variables.DisallowVariableVariable" />
217172
<rule ref="SlevomatCodingStandard.Variables.DuplicateAssignmentToVariable" />

0 commit comments

Comments
 (0)