Actions
Task #94553
closedEnforce trailing commas in multi line arrays with PHP CS Fixer
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Code Cleanup
Target version:
-
Start date:
2021-07-13
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
Sprint Focus:
Description
The PHP CS Fixer rule trailing_comma_in_multiline => ['arrays']
ensures that multi line arrays always have a trailing comma.
$array = [
'one',
'two'
];
becomes
$array = [
'one',
'two',
];
Having trailing commas makes it easier to rearrange entries and when an entry is added to the list the line before doesn't need to be changed. This results in smaller git changes for a better overview and less likely merge conflicts.
Actions