Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
33.33% |
1 / 3 |
|
50.00% |
1 / 2 |
CRAP | |
0.00% |
0 / 1 |
| CalcFunc | |
33.33% |
1 / 3 |
|
50.00% |
1 / 2 |
3.19 | |
0.00% |
0 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| toCss | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Phpdftk\Css\Value; |
| 6 | |
| 7 | final readonly class CalcFunc extends CalcExpression |
| 8 | { |
| 9 | /** @param list<CalcExpression> $args */ |
| 10 | public function __construct(public CalcFunction $func, public array $args) {} |
| 11 | |
| 12 | public function toCss(): string |
| 13 | { |
| 14 | $argStrings = array_map(static fn(CalcExpression $a): string => $a->toCss(), $this->args); |
| 15 | return $this->func->value . '(' . implode(', ', $argStrings) . ')'; |
| 16 | } |
| 17 | } |