Lines
100.00%
2 / 2
Methods
100.00%
2 / 2
Classes
100.00%
1 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| __construct | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| fromFieldsDroppingNulls | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| 8 | final readonly class ServiceFields | |
| 9 | { | |
| 10 | /** @param array<string, mixed> $fields */ | |
| 11 | private function __construct(public array $fields) {} | |
| 12 | ||
| 13 | /** @param array<string, mixed> $fields */ | |
| 14 | public static function fromFieldsDroppingNulls(array $fields): self | |
| 15 | { | |
| 16 | return new self(array_filter($fields, static fn(mixed $value): bool => $value !== null)); | |
| 17 | } | |
| 18 | } |