@@ -45,6 +45,9 @@ protected function __construct(
4545 ) {
4646 }
4747
48+ /**
49+ * Create a new instance of Archive.
50+ */
4851 abstract public static function read (string $ path ): self ;
4952
5053 protected function setup (string $ path ): static
@@ -62,75 +65,123 @@ protected function setup(string $path): static
6265 }
6366
6467 /**
68+ * Extract all files from archive.
69+ *
6570 * @return string[]
6671 */
6772 abstract public function extractAll (string $ toPath ): array ;
6873
6974 /**
75+ * Extract selected files from archive.
76+ *
7077 * @param ArchiveItem[] $files
7178 * @return string[]
7279 */
7380 abstract public function extract (string $ toPath , array $ files ): array ;
7481
82+ /**
83+ * Get path to the archive.
84+ */
7585 public function getPath (): string
7686 {
7787 return $ this ->path ;
7888 }
7989
90+ /**
91+ * Get extension of the archive.
92+ */
8093 public function getExtension (): string
8194 {
8295 return $ this ->extension ;
8396 }
8497
98+ /**
99+ * Get filename of the archive.
100+ */
85101 public function getFilename (): string
86102 {
87103 return $ this ->filename ;
88104 }
89105
106+ /**
107+ * Get basename of the archive.
108+ */
90109 public function getBasename (): string
91110 {
92111 return $ this ->basename ;
93112 }
94113
114+ /**
115+ * Get `ArchiveEnum` of the archive.
116+ */
95117 public function getType (): ArchiveEnum
96118 {
97119 return $ this ->type ;
98120 }
99121
122+ /**
123+ * Get first file from archive.
124+ */
100125 public function getFirst (): ArchiveItem
101126 {
102127 return reset ($ this ->files );
103128 }
104129
130+ /**
131+ * Get last file from archive.
132+ */
105133 public function getLast (): ArchiveItem
106134 {
107135 return end ($ this ->files );
108136 }
109137
138+ /**
139+ * Get files from archive.
140+ *
141+ * @return ArchiveItem[]
142+ */
110143 public function getFiles (): array
111144 {
112145 return $ this ->files ;
113146 }
114147
148+ /**
149+ * Get count of files.
150+ */
115151 public function getCount (): int
116152 {
117153 return $ this ->count ;
118154 }
119155
156+ /**
157+ * Get archive stat.
158+ */
120159 public function getStat (): ?ArchiveStat
121160 {
122161 return $ this ->stat ;
123162 }
124163
164+ /**
165+ * Get PDF metadata.
166+ */
125167 public function getPdf (): ?PdfMeta
126168 {
127169 return $ this ->pdf ;
128170 }
129171
172+ /**
173+ * Get content from file.
174+ */
130175 abstract public function getContent (?ArchiveItem $ file , bool $ toBase64 = false ): ?string ;
131176
177+ /**
178+ * Get text from file.
179+ */
132180 abstract public function getText (ArchiveItem $ file ): ?string ;
133181
182+ /**
183+ * Find file by search to get `ArchiveItem`.
184+ */
134185 public function find (string $ search , bool $ skipHidden = true ): ?ArchiveItem
135186 {
136187 $ files = $ this ->findFiles ($ search , $ skipHidden );
@@ -143,6 +194,8 @@ public function find(string $search, bool $skipHidden = true): ?ArchiveItem
143194 }
144195
145196 /**
197+ * Filter files by search to get `ArchiveItem[]`.
198+ *
146199 * @return ArchiveItem[]|null
147200 */
148201 public function filter (string $ search , bool $ skipHidden = true ): ?array
0 commit comments