Skip to content

Commit 73d0b32

Browse files
committed
Fixes
File Zip
1 parent b2d179f commit 73d0b32

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

component/File.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ public static function cleanFilename(string $fileName): string
5555
return $fileName . '.' . $extension;
5656
}
5757

58-
public static function download(string $distantPath, ?string $localPath = null): string
58+
public static function download(string $distantPath, ?string $localPath = null): self
5959
{
6060
if (!$localPath) {
6161
$localPath = self::getTemoraryDirectory() . date('Y-m-d_H-i-s') . '-' . self::cleanFilename($distantPath);
6262
}
6363

6464
file_put_contents($localPath, fopen($distantPath, 'r'));
6565

66-
return $localPath;
66+
return new self($localPath);
6767
}
6868
}

component/Zip.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Zip extends File
99
{
1010
public function unarchive(?string $unarchiveDirectory = null): array
1111
{
12-
if ($unarchiveDirectory) {
12+
if (is_null($unarchiveDirectory)) {
1313
$unarchiveDirectory = self::getTemoraryDirectory() . pathinfo($this->path, PATHINFO_FILENAME) . '/';
1414
}
1515

0 commit comments

Comments
 (0)