Skip to content

Commit eea539b

Browse files
authored
Merge pull request #89 from Rom1-B/feat_php-cs-fixer
Feat php cs fixer
2 parents e283c25 + db5e7e7 commit eea539b

33 files changed

+4078
-2148
lines changed

.github/dependabot.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: 2
2+
updates:
3+
# Ensure GitHub Actions are used in their latest version
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "monthly"
8+
9+
# Strategy for composer dependencies
10+
- package-ecosystem: "composer"
11+
directory: "/"
12+
schedule:
13+
interval: "monthly"
14+
allow:
15+
- dependency-type: "direct"
16+
open-pull-requests-limit: 100
17+
versioning-strategy: "increase"
18+
groups:
19+
dev-dependencies:
20+
dependency-type: "development"

.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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"php": ">=7.4"
44
},
55
"require-dev": {
6-
"glpi-project/tools": "^0.5"
6+
"friendsofphp/php-cs-fixer": "^3.75",
7+
"glpi-project/tools": "^0.7.5"
78
},
89
"config": {
910
"optimize-autoloader": true,

0 commit comments

Comments
 (0)