Project

General

Profile

Actions

Task #94553

closed

Enforce trailing commas in multi line arrays with PHP CS Fixer

Added by Sebastian Michaelsen over 3 years ago. Updated about 3 years ago.

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.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #95357: Add trailing comma to array in ext:redirects SlugServiceClosed2021-09-25

Actions
Actions

Also available in: Atom PDF