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

tito10047 / progressive-image-bundle / 31935184880

16 Aug 2026 07:56AM UTC coverage: 96.069% (+5.4%) from 90.637%
31935184880

push

github

web-flow
Merge pull request #11 from tito10047/v2.0

V2.0

1359 of 1412 new or added lines in 91 files covered. (96.25%)

2004 of 2086 relevant lines covered (96.07%)

366.76 hits per line

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

83.33
/src/Variant/Infrastructure/PostProcess/JpegoptimPostProcessor.php
1
<?php
2

3
/*
4
 * This file is part of the Progressive Image Bundle.
5
 *
6
 * (c) Jozef Môstka <https://github.com/tito10047/progressive-image-bundle>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11

12
declare(strict_types=1);
13

14
namespace Tito10047\ProgressiveImageBundle\Variant\Infrastructure\PostProcess;
15

16
use Symfony\Component\Process\Process;
17
use Tito10047\ProgressiveImageBundle\Variant\Domain\Exception\VariantDomainException;
18
use Tito10047\ProgressiveImageBundle\Variant\Domain\Model\OutputFormat;
19

20
final readonly class JpegoptimPostProcessor extends CliPostProcessor
21
{
22
    public function supports(OutputFormat $format): bool
23
    {
24
        return OutputFormat::Jpeg === $format;
26✔
25
    }
26

27
    protected function buildCommand(string $inputPath, string $outputPath): array
28
    {
29
        // --stdout leaves the input file untouched and prints the optimized bytes on
30
        // stdout instead — no separate output file needed for this one.
31
        return [$this->bin, '--strip-all', '--stdout', $inputPath];
39✔
32
    }
33

34
    protected function readResult(Process $process, string $inputPath, string $outputPath): string
35
    {
36
        $contents = $process->getOutput();
26✔
37
        if ('' === $contents) {
26✔
NEW
38
            throw new VariantDomainException(sprintf('%s produced empty stdout output.', static::class));
×
39
        }
40

41
        return $contents;
26✔
42
    }
43
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc