Skip to content

Commit 0137fe4

Browse files
Fix 'Enforce that an expression gets used' errors
1 parent 3a5e100 commit 0137fe4

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/Formatters.php

+5-8
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,9 @@
88

99
function selectFormatter(array $tree, string $format): string
1010
{
11-
switch ($format) {
12-
case 'plain':
13-
return plain($tree);
14-
case 'json':
15-
return json($tree);
16-
default:
17-
return stylish($tree);
18-
}
11+
return match ($format) {
12+
'plain' => plain($tree),
13+
'json' => json($tree),
14+
default => stylish($tree),
15+
};
1916
}

0 commit comments

Comments
 (0)