Skip to content

Commit

Permalink
The files are required. Use constructor again.
Browse files Browse the repository at this point in the history
  • Loading branch information
aerni committed Aug 13, 2024
1 parent e3b1096 commit b7de02a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 20 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ php please zipper:clean --scope=force
You may also use this addon programmatically, as shown below.

```php
use Aerni\Zipper\Facades\Zipper;
use Aerni\Zipper\Zipper;

// Prepare an array of Statamic assets, paths, or URLs.
$files = [
Expand Down
13 changes: 0 additions & 13 deletions src/Facades/Zipper.php

This file was deleted.

12 changes: 7 additions & 5 deletions src/Zipper.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,18 @@ class Zipper

protected int $expiry;

public function __construct() {}

public function make(array $files): self
public function __construct(array $files)
{
return $this
->files($files)
$this->files($files)
->filename(time())
->expiry((int) config('zipper.expiry'));
}

public static function make(array $files): self
{
return new self($files);
}

/**
* Get and set the files to zip.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/ZipperTags.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Aerni\Zipper;

use Aerni\Zipper\Facades\Zipper;
use Aerni\Zipper\Zipper;
use Illuminate\Support\Arr;
use Statamic\Contracts\Assets\Asset;
use Statamic\Facades\Compare;
Expand Down

0 comments on commit b7de02a

Please sign in to comment.