From 52adc1dbea1e36d884196783cbdbc92cd1ded5aa Mon Sep 17 00:00:00 2001 From: jrfnl Date: Wed, 16 Jun 2021 15:46:43 +0200 Subject: [PATCH] PHPCS: use PHPCompatibility proper, not PHPCompatibilityWP When adding the `TypeError`/`Error` polyfill (#36), I suddenly realized that the use of the `PHPCompatibilityWP` ruleset by the `Yoast` standard was causing certain issues not to show up, while - for this repo - they **_should_** be shown. By setting the `severity` of all the sniffs in the `PHPCompatibilility` ruleset back to `5`, the `exclude`s from the `PHPCompatibilityWP` ruleset are effectively "undone" and we are back to using `PHPCompatibility` proper. --- .phpcs.xml.dist | 8 ++++++++ src/Polyfills/AssertIsType.php | 2 ++ 2 files changed, 10 insertions(+) diff --git a/.phpcs.xml.dist b/.phpcs.xml.dist index 8223ff4..710fb4c 100644 --- a/.phpcs.xml.dist +++ b/.phpcs.xml.dist @@ -50,6 +50,14 @@ + + + + + 5 diff --git a/src/Polyfills/AssertIsType.php b/src/Polyfills/AssertIsType.php index 8ddcbf7..2d42f01 100644 --- a/src/Polyfills/AssertIsType.php +++ b/src/Polyfills/AssertIsType.php @@ -155,6 +155,7 @@ public static function assertIsCallable( $actual, $message = '' ) { public static function assertIsIterable( $actual, $message = '' ) { if ( \function_exists( 'is_iterable' ) === true ) { // PHP >= 7.1. + // phpcs:ignore PHPCompatibility.FunctionUse.NewFunctions.is_iterableFound static::assertTrue( \is_iterable( $actual ), $message ); } else { @@ -302,6 +303,7 @@ public static function assertIsNotCallable( $actual, $message = '' ) { public static function assertIsNotIterable( $actual, $message = '' ) { if ( \function_exists( 'is_iterable' ) === true ) { // PHP >= 7.1. + // phpcs:ignore PHPCompatibility.FunctionUse.NewFunctions.is_iterableFound static::assertFalse( \is_iterable( $actual ), $message ); } else {