Skip to content

Commit

Permalink
Add second static factory
Browse files Browse the repository at this point in the history
and improve variable naming
  • Loading branch information
Schrank authored May 24, 2024
1 parent 07adeac commit 4d9485a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/ZugferdDocumentPdfBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,22 @@ class ZugferdDocumentPdfBuilder extends ZugferdDocumentPdfBuilderAbstract
/**
* @see self::__construct
*/
public static function fromPdfFile(ZugferdDocumentBuilder $documentBuilder, string $pdfData): self
public static function fromPdfFile(ZugferdDocumentBuilder $documentBuilder, string $pdfFileName): self
{
if (!is_file($pdfData)) {
throw new \InvalidArgumentException("The given PDF file does not exist.");
}
return new self($documentBuilder, $pdfData);
return new self($documentBuilder, $pdfFileName);
}

/**
* @see self::__construct
*/
public static function fromPdfString(ZugferdDocumentBuilder $documentBuilder, string $pdfContent): self
{
return new self($documentBuilder, $pdfContent);
}


/**
* Constructor
Expand Down

0 comments on commit 4d9485a

Please sign in to comment.