Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
50.00% |
1 / 2 |
|
50.00% |
1 / 2 |
CRAP | |
0.00% |
0 / 1 |
| Transform | |
50.00% |
1 / 2 |
|
50.00% |
1 / 2 |
2.50 | |
0.00% |
0 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| toCss | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Phpdftk\Css\Value; |
| 6 | |
| 7 | /** |
| 8 | * A value of the `transform` property: a list of transform functions to |
| 9 | * compose in source order (left-to-right is innermost-to-outermost per CSS |
| 10 | * Transforms 2 ยง3). |
| 11 | */ |
| 12 | final readonly class Transform extends Value |
| 13 | { |
| 14 | /** @param list<TransformFunction> $functions */ |
| 15 | public function __construct(public array $functions) {} |
| 16 | |
| 17 | public function toCss(): string |
| 18 | { |
| 19 | return implode(' ', array_map(static fn(TransformFunction $f): string => $f->toCss(), $this->functions)); |
| 20 | } |
| 21 | } |