Skip to content

Commit

Permalink
[ENH] #244 Make isFile() and xmlDataIsFile() methods overridable
Browse files Browse the repository at this point in the history
  • Loading branch information
HorstOeko committed Jan 28, 2025
1 parent d3fcfc4 commit 4efdc37
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/ZugferdDocumentPdfBuilderAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,11 @@ protected function extractInvoiceInformations(): array
*/
protected function isFile($pdfData): bool
{
return is_file($pdfData);
try {
return is_file($pdfData);
} catch (Throwable $throwable) {
return false;
}
}

/**
Expand Down
6 changes: 5 additions & 1 deletion src/ZugferdDocumentPdfMerger.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ protected function getXmlAttachmentXmpName(): string
*/
protected function xmlDataIsFile(): bool
{
return is_file($this->xmlDataOrFilename);
try {
return is_file($this->xmlDataOrFilename);
} catch (\TypeError $typeError) {
return false;
}
}

/**
Expand Down

0 comments on commit 4efdc37

Please sign in to comment.