Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
Warning
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace Phpdftk\HtmlToPdf;
6
7/**
8 * One diagnostic event from the renderer. Collected in {@see RenderResult}
9 * after a `render()` / `renderInto()` call. In `strict` mode warnings of
10 * severity `Error` instead throw a {@see StrictModeException}.
11 *
12 * `context` is a free-form bag of relevant key-values (e.g. the offending
13 * CSS property name, the missing font's family, the failed URL). Keys are
14 * stable for a given code so log aggregators can dispatch off them.
15 */
16final readonly class Warning
17{
18    /** @param array<string, scalar|null> $context */
19    public function __construct(
20        public WarningCode $code,
21        public string $message,
22        public WarningSeverity $severity = WarningSeverity::Warning,
23        public array $context = [],
24    ) {}
25}