diff options
Diffstat (limited to 'vendor/michelf/php-markdown/test/helpers/MarkdownTestHelper.php')
-rw-r--r-- | vendor/michelf/php-markdown/test/helpers/MarkdownTestHelper.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/vendor/michelf/php-markdown/test/helpers/MarkdownTestHelper.php b/vendor/michelf/php-markdown/test/helpers/MarkdownTestHelper.php index ffca0c969..fc746366c 100644 --- a/vendor/michelf/php-markdown/test/helpers/MarkdownTestHelper.php +++ b/vendor/michelf/php-markdown/test/helpers/MarkdownTestHelper.php @@ -22,7 +22,6 @@ class MarkdownTestHelper $dataValues = array(); - /** @var SplFileInfo $inputFile */ foreach ($regexIterator as $inputFiles) { foreach ($inputFiles as $inputMarkdownPath) { $xhtml = true; @@ -163,6 +162,7 @@ class MarkdownTestHelper foreach ($node_list as $node) { switch ($node->nodeType) { case XML_ELEMENT_NODE: + /** @var DOMElement $node */ static::normalizeElementContent($node, $whitespace_preserve); static::normalizeElementAttributes($node); @@ -207,6 +207,7 @@ class MarkdownTestHelper break; case XML_TEXT_NODE: + /** @var DOMText $node */ if (!$whitespace_preserve) { if (trim($node->data) === "") { $node->data = $whitespace; @@ -222,8 +223,8 @@ class MarkdownTestHelper ($whitespace === "\n\n" || $whitespace === "\n")) { if ($element->firstChild) { if ($element->firstChild->nodeType == XML_TEXT_NODE) { - $element->firstChild->data = - preg_replace('{^\s+}', "\n", $element->firstChild->data); + $element->firstChild->data = // @phpstan-ignore-line + preg_replace('{^\s+}', "\n", $element->firstChild->data ?? ''); } else { $element->insertBefore(new DOMText("\n"), $element->firstChild); @@ -231,8 +232,8 @@ class MarkdownTestHelper } if ($element->lastChild) { if ($element->lastChild->nodeType == XML_TEXT_NODE) { - $element->lastChild->data = - preg_replace('{\s+$}', "\n", $element->lastChild->data); + $element->lastChild->data = // @phpstan-ignore-line + preg_replace('{\s+$}', "\n", $element->lastChild->data ?? ''); } else { $element->insertBefore(new DOMText("\n"), null); |