Lines 100.00% 2 / 2
Functions and Methods 100.00% 2 / 2
Classes and Traits 100.00% 1 / 1
Name Lines Functions and Methods CRAP Classes and Traits
ServiceFields 100.00% 2 / 2 100.00% 2 / 2 2 100.00% 1 / 1
 __construct 100.00% 1 / 1 100.00% 1 / 1 1
 fromFieldsDroppingNulls 100.00% 1 / 1 100.00% 1 / 1 1
1<?php
2
3declare(strict_types=1);
4
5namespace Stewart\Support\Wire;
6
7/** @internal */
8final 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}