Skip to content

Commit a64f14e

Browse files
authored
Add php-cs-fixer (#133)
1 parent e390338 commit a64f14e

File tree

14 files changed

+3198
-1403
lines changed

14 files changed

+3198
-1403
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: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@
33
"php": ">=7.4"
44
},
55
"require-dev": {
6+
"friendsofphp/php-cs-fixer": "^3.73",
67
"glpi-project/tools": "^0.7"
78
},
89
"config": {
910
"optimize-autoloader": true,
1011
"platform": {
1112
"php": "7.4.0"
1213
},
13-
"sort-packages": true
14+
"sort-packages": true,
15+
"allow-plugins": {
16+
"phpstan/extension-installer": true
17+
}
1418
}
1519
}

0 commit comments

Comments
 (0)