File tree Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -77,17 +77,21 @@ public function convert(): string
77
77
78
78
public function convertNode (DOMNode $ node ): DOMNode
79
79
{
80
- if ($ node ->nodeType === XML_TEXT_NODE ) {
81
- return $ node ;
82
- }
83
-
84
- if ($ node ->nodeType === XML_ELEMENT_NODE ) {
85
- //echo "\nElement node found";
86
- /** @var DOMElement $node */
87
- $ this ->replaceShowWithIf ($ node );
88
- $ this ->handleIf ($ node );
89
- } elseif ($ node ->nodeType === XML_HTML_DOCUMENT_NODE ) {
90
- $ this ->logger ->warning ("Document node found. " );
80
+ switch ($ node ->nodeType ) {
81
+ case XML_TEXT_NODE :
82
+ $ this ->logger ->debug ('Text node found ' , ['name ' => $ node ->nodeName ]);
83
+ // fall through to next case, because we don't need to handle either of these node-types
84
+ case XML_COMMENT_NODE :
85
+ $ this ->logger ->debug ('Comment node found ' , ['name ' => $ node ->nodeName ]);
86
+ return $ node ;
87
+ case XML_ELEMENT_NODE :
88
+ /** @var DOMElement $node */
89
+ $ this ->replaceShowWithIf ($ node );
90
+ $ this ->handleIf ($ node );
91
+ break ;
92
+ case XML_HTML_DOCUMENT_NODE :
93
+ $ this ->logger ->warning ("Document node found. " );
94
+ break ;
91
95
}
92
96
93
97
$ this ->stripEventHandlers ($ node );
You can’t perform that action at this time.
0 commit comments