Skip to content

Commit

Permalink
Ensure trailing_comma_in_multiline is compatible with PHP 7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
spawnia committed Sep 2, 2024
1 parent d44c76c commit 0ba246f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ Shared configuration for php-cs-fixer

## Installation

composer require --dev mll-lab/php-cs-fixer-config
```sh
composer require --dev mll-lab/php-cs-fixer-config
```

## Usage

Expand Down
8 changes: 8 additions & 0 deletions config.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ function config(Finder $finder, array $ruleOverrides = []): Config
'phpdoc_to_comment' => false, // Intermediary PHPDocs are sometimes useful to provide type assertions for PHPStan
'single_line_empty_body' => true,
'single_line_throw' => false,
// TODO add trailing commas everywhere when dropping PHP 7.4
'trailing_comma_in_multiline' => [
'after_heredoc' => true,
'elements' => [
'array_destructuring',
'arrays',
],
],
'yoda_style' => [ // Not necessary with static analysis, non-Yoda is more natural to write and read
'equal' => false,
'identical' => false,
Expand Down

0 comments on commit 0ba246f

Please sign in to comment.