Skip to content

Commit

Permalink
Append uri resolver issues to typeset result
Browse files Browse the repository at this point in the history
  • Loading branch information
jsiefer committed Apr 7, 2022
1 parent b16889e commit d9db41e
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/PdfGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,14 @@ public function __construct(array $schemes = [], string $baseUri = null, string
*/
public function render(string $html): Result
{
$this->uriResolver->errors = [];

$result = $this->htmlToPdf->render($html, $this->uriResolver);
$result->version=$this->version;
$result->version = $this->version;

if ($this->uriResolver->errors) {
array_push($result->issues, ...$this->uriResolver->errors);
}

return $result;
}
Expand All @@ -47,8 +53,14 @@ public function render(string $html): Result
*/
public function renderMultiple(array $html): Result
{
$this->uriResolver->errors = [];

$result = $this->htmlToPdf->renderMultiple($html, $this->uriResolver);
$result->version=$this->version;
$result->version = $this->version;

if ($this->uriResolver->errors) {
array_push($result->issues, ...$this->uriResolver->errors);
}

return $result;
}
Expand Down

0 comments on commit d9db41e

Please sign in to comment.