-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Milestone
Description
Using PSR-12 with current dev-master the PHP8 match clause and arrays have a "wrong" indentation interaction:
class TestClass
{
public function dada(string $type): array
{
return match ($type) {
'referrers' => [
'referrersNumber' => 'DESC',
'visitorsNumber' => 'DESC',
'viewsNumber' => 'DESC',
],
'orders' => [
'ordersNumber' => 'DESC',
'visitorsNumber' => 'DESC',
'viewsNumber' => 'DESC',
'referrersNumber' => 'DESC',
],
default => [
'visitorsNumber' => 'DESC',
'viewsNumber' => 'DESC',
'referrersNumber' => 'DESC',
],
};
}
}Reports the following errors:
18 | ERROR | [x] Line indented incorrectly; expected at least 16 spaces, found 12
19 | ERROR | [x] Line indented incorrectly; expected at least 16 spaces, found 12
23 | ERROR | [x] Line indented incorrectly; expected at least 16 spaces, found 12
The lines reported are the one before the default clause, the line with the default clause, and the ending array of the default clause. There errors always seem to start at the end of the second array, with or without a default clause. When using other types instead of arrays no errors occur.
Metadata
Metadata
Assignees
Labels
No labels