Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| Switch_ | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Phpdftk\Svg; |
| 6 | |
| 7 | /** |
| 8 | * SVG 2 §5.7 — `<switch>` evaluates each direct child element's |
| 9 | * conditional processing attributes (`requiredFeatures`, |
| 10 | * `requiredExtensions`, `systemLanguage`) and renders only the |
| 11 | * first child for which every test evaluates true. Children |
| 12 | * without any test attribute always pass. |
| 13 | * |
| 14 | * For the server-side print medium: |
| 15 | * |
| 16 | * - `requiredFeatures` (deprecated, SVG 1.1 holdover) — every |
| 17 | * listed feature URI evaluates true so the test never fails. |
| 18 | * - `requiredExtensions` — unknown URIs fail; common UA |
| 19 | * extensions are rejected since print can't observe them. |
| 20 | * - `systemLanguage` — matches the document's `xml:lang` / |
| 21 | * `lang` attribute using BCP 47 case-insensitive prefix |
| 22 | * comparison. |
| 23 | * |
| 24 | * The selection is computed eagerly at paint time from the |
| 25 | * Translator; this class is purely a typed container so the |
| 26 | * dispatch can pattern-match on it. |
| 27 | */ |
| 28 | final class Switch_ extends Element |
| 29 | { |
| 30 | public function __construct() |
| 31 | { |
| 32 | parent::__construct('switch'); |
| 33 | } |
| 34 | } |