Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| AtRule | |
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\Css\Sheet; |
| 6 | |
| 7 | /** |
| 8 | * `@name <prelude> { … }` or `@name <prelude>;` — the at-rule form. |
| 9 | * |
| 10 | * `prelude` is the raw text between the at-keyword and the block / semicolon |
| 11 | * (whitespace-collapsed); consumers like the cascade re-parse it into typed |
| 12 | * structures (media queries, page selectors, etc.) using helpers in the |
| 13 | * relevant subsystem. |
| 14 | * |
| 15 | * `block` is null for declaration-only at-rules (`@charset`, `@import`, |
| 16 | * `@namespace`); a populated {@see AtRuleBlock} otherwise. |
| 17 | */ |
| 18 | final readonly class AtRule extends Rule |
| 19 | { |
| 20 | public function __construct( |
| 21 | public string $name, |
| 22 | public string $prelude, |
| 23 | public ?AtRuleBlock $block, |
| 24 | ) {} |
| 25 | } |