Skip to content

Commit 3dad197

Browse files
authored
Add php-cs-fixer (#70)
1 parent a529e93 commit 3dad197

File tree

12 files changed

+3012
-1224
lines changed

12 files changed

+3012
-1224
lines changed

.php-cs-fixer.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
use PhpCsFixer\Config;
4+
use PhpCsFixer\Finder;
5+
6+
$finder = Finder::create()
7+
->in(__DIR__)
8+
->name('*.php')
9+
->ignoreVCSIgnored(true);
10+
11+
$config = new Config();
12+
13+
$rules = [
14+
'@PER-CS2.0' => true,
15+
'trailing_comma_in_multiline' => ['elements' => ['arguments', 'array_destructuring', 'arrays']], // For PHP 7.4 compatibility
16+
];
17+
18+
return $config
19+
->setRules($rules)
20+
->setFinder($finder)
21+
->setUsingCache(false);

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"php": ">=7.4"
44
},
55
"require-dev": {
6+
"friendsofphp/php-cs-fixer": "^3.68",
67
"glpi-project/tools": "^0.7",
78
"php-parallel-lint/php-parallel-lint": "^1.4",
89
"phpstan/extension-installer": "^1.4",

0 commit comments

Comments
 (0)