Skip to content

Commit

Permalink
[ENH] #244 Make isFile() and xmlDataIsFile() methods overridable
Browse files Browse the repository at this point in the history
HorstOeko committed Jan 28, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 45524d7 commit d3fcfc4
Showing 2 changed files with 2 additions and 10 deletions.
6 changes: 1 addition & 5 deletions src/ZugferdDocumentPdfBuilderAbstract.php
Original file line number Diff line number Diff line change
@@ -667,11 +667,7 @@ protected function extractInvoiceInformations(): array
*/
protected function isFile($pdfData): bool
{
try {
return is_file($pdfData) && !is_link($pdfData) && is_readable($pdfData);
} catch (Throwable $throwable) {
return false;
}
return is_file($pdfData);
}

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

/**

0 comments on commit d3fcfc4

Please sign in to comment.