Skip to content

Commit

Permalink
Patch whitespace issue
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksagona committed Feb 4, 2024
1 parent 5771d4d commit 293927a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Child.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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}</{$this->nodeName}>" . ((!$this->preserveWhiteSpace) ? '' : "\n");
$this->output .= ((!$this->preserveWhiteSpace) ? '' : "\n") .
"{$this->nodeValue}" . ((!$this->preserveWhiteSpace) ? '' : "\n") .
"</{$this->nodeName}>" . ((!$this->preserveWhiteSpace) ? '' : "\n");
} else {
$this->output .= " />";
if ($this->preserveWhiteSpace) {
Expand Down

0 comments on commit 293927a

Please sign in to comment.