Skip to content

Commit

Permalink
more cache output options supported
Browse files Browse the repository at this point in the history
  • Loading branch information
jszobody committed Jul 5, 2024
1 parent cb79150 commit 4927735
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,12 @@ public function getComment(): string

public function cache($output): self
{
if (!$output instanceof FileContract) {
$output = File::make($output);
}

$this->cacheOutputStream = $output->getWritableStream();
$this->cacheOutputStream = match (true) {
$output instanceof StreamInterface => $output,
$output instanceof FileContract => $output->getWritableStream(),
is_string($output) => File::makeWriteable($output)->getWritableStream(),
default => throw new InvalidArgumentException('Invalid cache output provided'),
};

return $this;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Models/TempFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class TempFile extends File
{
protected function getDefaultZipPath()
protected function getDefaultZipPath(): string
{
// For temp files (raw data provided) you MUST specify the zip path
throw new FilenameMissingException();
Expand Down

0 comments on commit 4927735

Please sign in to comment.