docs
docs copied to clipboard
Code style summary to discuss and configure
Trailing comma after last argument (if they are split into multiple lines):
$this->assertSame(
['' => ['Value must be no less than 5.']],
$result->getErrorMessagesIndexedByPath(),
);
vs
$this->assertSame(
['' => ['Value must be no less than 5.']],
$result->getErrorMessagesIndexedByPath()
);
The first option is already used for array elements, but not automated.
I like the first. The same about a function parameters declaration.
First one. It's more consistent with arrays:
$array = [
'foo',
'boo',
];
and it easier/more friendly to developer - needs less actions when move last item:
- move line
vs
- move line,
- add comma to moved line
- remove comma to actual last line
1st way is good to go.
https://docs.styleci.io/fixers#trailing_comma_in_multiline_call