Skip to content

Commit eb5bfa8

Browse files
committed
Simplify DataType codebase
1 parent 592d402 commit eb5bfa8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/DataType.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ public function parse(Stringable|string $httpValue): StructuredField
3333
*/
3434
public function build(iterable $data): string
3535
{
36-
return match ($this) {
37-
self::Dictionary => Dictionary::fromPairs($data)->toHttpValue(),
38-
self::Parameters => Parameters::fromPairs($data)->toHttpValue(),
39-
self::List => OuterList::fromPairs($data)->toHttpValue(),
40-
self::InnerList => InnerList::fromPair([...$data])->toHttpValue(), /* @phpstan-ignore-line */
41-
self::Item => Item::fromPair([...$data])->toHttpValue(), /* @phpstan-ignore-line */
42-
};
36+
return (match ($this) {
37+
self::Dictionary => Dictionary::fromPairs($data),
38+
self::Parameters => Parameters::fromPairs($data),
39+
self::List => OuterList::fromPairs($data),
40+
self::InnerList => InnerList::fromPair([...$data]), /* @phpstan-ignore-line */
41+
self::Item => Item::fromPair([...$data]), /* @phpstan-ignore-line */
42+
})->toHttpValue();
4343
}
4444
}

0 commit comments

Comments
 (0)