CompressionInterface.php
33 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WPStaging\Backup\Service\Compression; |
| 4 | |
| 5 | use RuntimeException; |
| 6 | use WPStaging\Backup\Entity\FileBeingExtracted; |
| 7 | use WPStaging\Framework\Filesystem\FileObject; |
| 8 | |
| 9 | interface CompressionInterface |
| 10 | { |
| 11 | /** |
| 12 | * @param string $string String to compress. |
| 13 | * @return string Compressed string on success, throws an exception on failure. |
| 14 | * @throws RuntimeException |
| 15 | */ |
| 16 | public function compress(string $string): string; |
| 17 | |
| 18 | /** |
| 19 | * @param string $string String to decompress. |
| 20 | * @return string Decompressed string on success, throws an exception on failure. |
| 21 | * @throws RuntimeException |
| 22 | */ |
| 23 | public function decompress(string $string): string; |
| 24 | |
| 25 | /** |
| 26 | * @param FileObject $wpstgFile |
| 27 | * @param FileBeingExtracted $extractingFile |
| 28 | * @param callable $callable |
| 29 | * @return string |
| 30 | */ |
| 31 | public function readChunk(FileObject $wpstgFile, FileBeingExtracted $fileBeingExtracted, callable $callable = null): string; |
| 32 | } |
| 33 |