@@ -207,7 +207,7 @@ protected function buildNodeFromDomElement(\DOMNode $element, bool $allowLtrim =
207207
208208 if (\count ($ attributes ) > 0 ) {
209209 // the span has attributes, so enclose its childNodes in CommonmarkContainers
210- $ openingNode = new InlineCommonmarkContainer (sprintf (
210+ $ openingNode = new InlineCommonmarkContainer (\ sprintf (
211211 '<span%s> ' ,
212212 $ this ->outputAttributes ($ attributes ),
213213 ));
@@ -292,15 +292,15 @@ protected function buildNodeFromDomElement(\DOMNode $element, bool $allowLtrim =
292292 // try to let self-closed html tags as-is
293293 preg_match ('/^<\s*([a-z0-9-]+)(\s[^>]*)?\/>$/ ' , $ elementXml , $ matches );
294294
295- if (isset ($ matches [1 ]) && preg_match (sprintf ('/^<%s(\s[^>]*)?\>.*<\/%s>$/ ' , $ matches [1 ], $ matches [1 ]), $ converted , $ subMatches )) {
295+ if (isset ($ matches [1 ]) && preg_match (\ sprintf ('/^<%s(\s[^>]*)?\>.*<\/%s>$/ ' , $ matches [1 ], $ matches [1 ]), $ converted , $ subMatches )) {
296296 if (\in_array ($ matches [1 ], ['br ' , 'hr ' , 'source ' ])) {
297297 $ converted = $ elementXml ;
298298 } else {
299299 $ converted = $ elementHtml ;
300300 }
301301 }
302302
303- if (isset ($ tagNameMatches [1 ]) || isset ($ matches [1 ]) && preg_match (sprintf ('/^<%s(\s.*)?>$/ ' , $ matches [1 ]), $ converted , $ subMatches )) {
303+ if (isset ($ tagNameMatches [1 ]) || isset ($ matches [1 ]) && preg_match (\ sprintf ('/^<%s(\s.*)?>$/ ' , $ matches [1 ]), $ converted , $ subMatches )) {
304304 $ attributes = [];
305305 }
306306 } else {
@@ -445,10 +445,10 @@ protected function fixAndReplace(string|array $literal, Node|array $nodes, strin
445445 $ attributes = '' ;
446446
447447 foreach ($ nodes [0 ]->data ->get ('attributes ' ) as $ key => $ value ) {
448- $ attributes .= sprintf (' %s="%s" ' , $ key , Xml::escape ($ value ));
448+ $ attributes .= \ sprintf (' %s="%s" ' , $ key , Xml::escape ($ value ));
449449 }
450450
451- $ literal = sprintf ('<div%s>%s</div> ' , $ attributes , $ literal );
451+ $ literal = \ sprintf ('<div%s>%s</div> ' , $ attributes , $ literal );
452452 }
453453
454454 $ dom = new \DOMDocument ();
@@ -498,6 +498,7 @@ protected function removeNode(Node $node): void
498498
499499 foreach ($ newChildren as $ key => $ child ) {
500500 if ($ child === $ node ) {
501+ // @phpstan-ignore offsetAccess.nonOffsetAccessible
501502 unset($ newChildren [$ key ]);
502503 }
503504 }
@@ -602,7 +603,7 @@ private function fixHtmlBlock(HtmlBlock $node): ?iterable
602603 }
603604
604605 if (!$ isClosed ) {
605- $ this ->logger ->info (sprintf ('<%s> tag is NOT closed ' , $ matches [1 ]));
606+ $ this ->logger ->info (\ sprintf ('<%s> tag is NOT closed ' , $ matches [1 ]));
606607 }
607608
608609 $ fixedNodes = $ this ->fixAndReplace ($ literal , $ closingNodes );
0 commit comments