1 | <?php |
||
9 | class Zip |
||
10 | { |
||
11 | /** @var \ZipArchive */ |
||
12 | protected $zipFile; |
||
13 | |||
14 | /** @var int */ |
||
15 | protected $fileCount = 0; |
||
16 | |||
17 | /** @var string */ |
||
18 | protected $pathToZip; |
||
19 | |||
20 | /** @var string */ |
||
21 | protected $password; |
||
22 | |||
23 | public static function createForManifest(Manifest $manifest, string $pathToZip): self |
||
39 | |||
40 | protected static function determineNameOfFileInZip(string $pathToFile, string $pathToZip) |
||
52 | |||
53 | public static function formatZipFilename(string $filename): string |
||
57 | |||
58 | public function __construct(string $pathToZip) |
||
66 | |||
67 | public function path(): string |
||
71 | |||
72 | public function size(): int |
||
80 | |||
81 | public function humanReadableSize(): string |
||
85 | |||
86 | public function open() |
||
90 | |||
91 | public function close() |
||
95 | |||
96 | /** |
||
97 | * @param string|null $password |
||
98 | * @return Zip |
||
99 | */ |
||
100 | public function setPassword(?string $password): self |
||
106 | |||
107 | /** |
||
108 | * @param string $nameInZip |
||
109 | * |
||
110 | * @return Zip |
||
111 | */ |
||
112 | protected function passwordProtectFile(string $nameInZip): self |
||
124 | |||
125 | /** |
||
126 | * @param string|array $files |
||
127 | * @param string $nameInZip |
||
128 | * |
||
129 | * @return \Spatie\Backup\Tasks\Backup\Zip |
||
130 | */ |
||
131 | public function add($files, string $nameInZip = null): self |
||
154 | |||
155 | public function count(): int |
||
159 | } |
||
160 |
If you implement
__call
and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__call
is implemented by a parent class and only the child class knows which methods exist: