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 |
||
112 | |||
113 | /** |
||
114 | * @param string $nameInZip |
||
115 | * |
||
116 | * @return Zip |
||
117 | */ |
||
118 | protected function passwordProtectFile(string $nameInZip): self |
||
130 | |||
131 | /** |
||
132 | * @param string|array $files |
||
133 | * @param string $nameInZip |
||
134 | * |
||
135 | * @return \Spatie\Backup\Tasks\Backup\Zip |
||
136 | */ |
||
137 | public function add($files, string $nameInZip = null): self |
||
160 | |||
161 | public function count(): int |
||
165 | } |
||
166 |
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: