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

IGNF / validator-api / 24445873193

15 Apr 2026 09:02AM UTC coverage: 51.256%. Remained the same
24445873193

push

github

DD-Arras
fix: error on json_decode

0 of 1 new or added line in 1 file covered. (0.0%)

347 of 677 relevant lines covered (51.26%)

2.61 hits per line

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

0.0
/src/Export/PdfReportWriter.php
1
<?php
2

3
namespace App\Export;
4

5
use App\Entity\Validation;
6
use Knp\Snappy\Pdf;
7
use Twig\Environment;
8

9
class PdfReportWriter
10
{
11
    public function __construct(
12
        private readonly Pdf         $snappy,
13
        private readonly Environment $twig,
14
    ) {}
×
15

16
    /**
17
     * @param  Validation $validation
18
     * @return string  Raw PDF binary content
19
     */
20
    public function generate(Validation $validation): string
21
    {
NEW
22
        $entries = $validation->getResults();
×
23

24
        $hasErrors = (bool) array_filter(
×
25
            $entries,
×
26
            static fn(array $e): bool => strtolower($e['level']) === 'error'
×
27
        );
×
28

29
        $order  = ['error', 'warning', 'info'];
×
30
        $grouped = [];
×
31

32
        foreach ($entries as $entry) {
×
33
            $grouped[$entry['level']][] = $entry;
×
34
        }
35

36
        $html = $this->twig->render('pdfModel.html.twig', [
×
37
            'groupedEntries' => $grouped,
×
38
            'hasErrors'      => $hasErrors,
×
39
        ]);
×
40

41
        return $this->snappy->getOutputFromHtml($html, [
×
42
            'encoding'             => 'UTF-8',
×
43
            'enable-local-file-access' => true,
×
44
            'margin-top'           => '10mm',
×
45
            'margin-bottom'        => '10mm',
×
46
            'margin-left'          => '12mm',
×
47
            'margin-right'         => '12mm',
×
48
        ]);
×
49
    }
50
}
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