Skip to content

Commit

Permalink
Added output formatting option for HasRequestDom.php and HasResponseD…
Browse files Browse the repository at this point in the history
…om.php.
  • Loading branch information
firebed committed Jul 6, 2024
1 parent c126b73 commit 9aa0981
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Http/Traits/HasRequestDom.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ public function getRequestDom(): ?DOMDocument
return $this->requestDom;
}

public function getRequestXml(): ?string
public function getRequestXml(bool $formatOutput = true): ?string
{
$this->requestDom->formatOutput = $formatOutput;
return $this->requestDom?->saveXML();
}

Expand Down
3 changes: 2 additions & 1 deletion src/Http/Traits/HasResponseDom.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ public function getResponseDom(): ?DOMDocument
return $this->responseDom;
}

public function getResponseXML(): ?string
public function getResponseXML(bool $formatOutput = true): ?string
{
$this->responseDom->formatOutput = $formatOutput;
return $this->responseDom?->saveXML();
}

Expand Down

0 comments on commit 9aa0981

Please sign in to comment.