From 17ccd06bded3ed34e87ad22768bdafe1aa194aca Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Fri, 26 May 2023 16:44:11 +0100 Subject: [PATCH] Further reduce duplicate code --- .../Sniffs/Html/HtmlClosingVoidTagsSniff.php | 31 ------------------- .../Sniffs/Html/HtmlSelfClosingTagsSniff.php | 2 +- 2 files changed, 1 insertion(+), 32 deletions(-) diff --git a/Magento2/Sniffs/Html/HtmlClosingVoidTagsSniff.php b/Magento2/Sniffs/Html/HtmlClosingVoidTagsSniff.php index 6c8a67f2..b70c5a35 100644 --- a/Magento2/Sniffs/Html/HtmlClosingVoidTagsSniff.php +++ b/Magento2/Sniffs/Html/HtmlClosingVoidTagsSniff.php @@ -30,37 +30,6 @@ class HtmlClosingVoidTagsSniff extends HtmlSelfClosingTagsSniff implements Sniff */ private const WARNING_CODE = 'HtmlClosingVoidElements'; - /** - * List of void elements. - * - * https://html.spec.whatwg.org/multipage/syntax.html#void-elements - * - * @var string[] - */ - private const HTML_VOID_ELEMENTS = [ - 'area', - 'base', - 'br', - 'col', - 'embed', - 'hr', - 'img', - 'input', - 'link', - 'meta', - 'source', - 'track', - 'wbr', - ]; - - /** - * @inheritdoc - */ - public function register(): array - { - return [T_INLINE_HTML]; - } - /** * Detect use of self-closing tag with void html element. * diff --git a/Magento2/Sniffs/Html/HtmlSelfClosingTagsSniff.php b/Magento2/Sniffs/Html/HtmlSelfClosingTagsSniff.php index 7c3cf9bc..627b7152 100644 --- a/Magento2/Sniffs/Html/HtmlSelfClosingTagsSniff.php +++ b/Magento2/Sniffs/Html/HtmlSelfClosingTagsSniff.php @@ -23,7 +23,7 @@ class HtmlSelfClosingTagsSniff implements Sniff * * @var string[] */ - private const HTML_VOID_ELEMENTS = [ + protected const HTML_VOID_ELEMENTS = [ 'area', 'base', 'br',