From 293927a870b801cd7eb72aa483c8a1909be19868 Mon Sep 17 00:00:00 2001 From: Nick Sagona Date: Sun, 4 Feb 2024 11:40:35 -0600 Subject: [PATCH] Patch whitespace issue --- src/Child.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Child.php b/src/Child.php index 64e42ac..6e72ddf 100644 --- a/src/Child.php +++ b/src/Child.php @@ -103,7 +103,7 @@ public function __construct(string $name, ?string $value = null, array $options * @param array $options * @return Child */ - public static function create(string $name, ?string $value = null, array $options = []) + public static function create(string $name, ?string $value = null, array $options = []): Child { return new self($name, $value, $options); } @@ -555,7 +555,9 @@ public function render(int $depth = 0, ?string $indent = null, bool $inner = fal if (!$inner) { if (($this->nodeValue !== null) || ($this->nodeName == 'textarea')) { $this->output .= ">"; - $this->output .= "{$this->nodeValue}nodeName}>" . ((!$this->preserveWhiteSpace) ? '' : "\n"); + $this->output .= ((!$this->preserveWhiteSpace) ? '' : "\n") . + "{$this->nodeValue}" . ((!$this->preserveWhiteSpace) ? '' : "\n") . + "nodeName}>" . ((!$this->preserveWhiteSpace) ? '' : "\n"); } else { $this->output .= " />"; if ($this->preserveWhiteSpace) {