If the used match with not a lot of content, it is formatted as one line which is really tricky to read.
Prettier 2.6.2
PHP Plugin 0.18.4
{
"printWidth": 80,
"tabWidth": 4,
"useTabs": false,
"singleQuote": true,
"phpVersion": "8.1",
"trailingCommaPHP": true,
"braceStyle": "psr-2",
"requirePragma": false,
"insertPragma": false
}
Input:
<?php declare(strict_types=1);
match ($case) {
'foo' => ['bar'],
'cd' => [],
default => [],
};
Output:
<?php declare(strict_types=1);
match ($case) { 'foo' => ['bar'], 'cd' => [], default => [] };
Expected behavior:
To be formatted as it was with input, to put each "case" in a new line.
Playground sample
If the used
matchwith not a lot of content, it is formatted as one line which is really tricky to read.Prettier 2.6.2
PHP Plugin 0.18.4
{ "printWidth": 80, "tabWidth": 4, "useTabs": false, "singleQuote": true, "phpVersion": "8.1", "trailingCommaPHP": true, "braceStyle": "psr-2", "requirePragma": false, "insertPragma": false }Input:
Output:
Expected behavior:
To be formatted as it was with input, to put each "case" in a new line.
Playground sample