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
Url
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\Svg\Value\Paint;
6
7use Phpdftk\Svg\Value\Paint;
8
9/**
10 * `url(#id) [ none | <color> ]` — a reference to a gradient, pattern, or
11 * other paint server defined elsewhere in the document, with an optional
12 * fallback paint used when the referent can't be resolved.
13 *
14 * Per SVG 2 §13.2 the fallback can only be `none` or `<color>`; a chained
15 * `url(...)` is not a legal fallback, so `parse()` strips it.
16 */
17final class Url extends Paint
18{
19    public function __construct(
20        public readonly string $id,
21        public readonly ?Paint $fallback = null,
22    ) {}
23}