From 63b1f40e10281b8dfa899bb5a48887cacf361f16 Mon Sep 17 00:00:00 2001 From: Dennis Snell Date: Fri, 28 Jul 2023 13:49:31 -0700 Subject: [PATCH] Ignore HTML Processor until PHPCS bug is resolved. See https://github.com/squizlabs/PHP_CodeSniffer/issues/3685 PHP Code Sniffer mistakes the following code, thinking that it throws an exception even though the exception is caught in place. ```php try { throw new WP_HTML_Unsupported_Exception( 'The outside never sees me.' ); } catch ( WP_HTML_Unsupported_Excepted $e ) { return false; } ``` This patch adds an exclude for the HTML Processor where PHPCS is confused. Until that bug is fixed this is a pragmatic solution to avoiding the need to change actual code around a bug in a linting tool. When that bug is fixed and it no longer gets confused this exclusion should be removed. --- phpcs.xml.dist | 2 ++ 1 file changed, 2 insertions(+) diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 43bc593090c4a..deefb843dd4e6 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -85,6 +85,8 @@ phpunit/* + + lib/compat/wordpress-6.4/html-api/class-wp-html-processor.php phpunit/*