• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tito10047 / migration-backup / 23041526045

13 Mar 2026 07:54AM UTC coverage: 86.131% (+19.5%) from 66.667%
23041526045

Pull #2

github

tito10047
update database URLs with version-specific server hints
Pull Request #2: add multi-format compression support (gzip, bzip2, zstd, zip, lz4, no…

92 of 111 new or added lines in 8 files covered. (82.88%)

236 of 274 relevant lines covered (86.13%)

57.79 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

76.92
/src/Compressor/Lz4Compressor.php
1
<?php
2

3
namespace Tito10047\MigrationBackup\Compressor;
4

5
use Symfony\Component\Filesystem\Filesystem;
6
use RuntimeException;
7

8
class Lz4Compressor implements CompressorInterface {
9
        public function __construct(
10
                private readonly Filesystem $fs
11
        ) {}
63✔
12

13
        public function compress(string $path): string {
14
                if (!$this->isAvailable()) {
21✔
NEW
15
                        throw new RuntimeException('LZ4 compression is not available (lz4 extension missing).');
×
16
                }
17

18
                $data = file_get_contents($path);
21✔
19
                if ($data === false) {
21✔
NEW
20
                        throw new RuntimeException('Could not read file for compression: ' . $path);
×
21
                }
22

23
                $compressed = lz4_compress($data);
21✔
24
                if ($compressed === false) {
21✔
NEW
25
                        throw new RuntimeException('LZ4 compression failed for file: ' . $path);
×
26
                }
27

28
                $this->fs->dumpFile($path, $compressed);
21✔
29

30
                return $path;
21✔
31
        }
32

33
        public function getExtension(): string {
34
                return '.lz4';
21✔
35
        }
36

37
        public function isAvailable(): bool {
38
                return function_exists('lz4_compress');
42✔
39
        }
40
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc