File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments