Lines 0.00% 0 / 8
Methods 0.00% 0 / 1
Classes 0.00% 0 / 1
Name Lines Methods CRAP
 formatStateChange 0.00% 0 / 8 0.00% 0 / 1 20
9final class ExposedStateFields
10{
11    /** @return array<string, mixed> */
12    public static function formatStateChange(ExposedStateChange $change): array
13    {
14        $fields = [];
15
16        if ($change->state !== null) {
17            $fields['state'] = $change->state->value;
18        }
19
20        if ($change->attributes !== null) {
21            $fields['attributes'] = $change->attributes;
22        }
23
24        if ($change->available !== null) {
25            $fields['available'] = $change->available;
26        }
27
28        return $fields;
29    }
30}