Skip to content

Commit 27e956a

Browse files
Add PHP-CS-Fixer
1 parent 2c051e4 commit 27e956a

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

.php-cs-fixer.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
use PhpCsFixer\Config;
4+
use PhpCsFixer\Finder;
5+
6+
$finder = Finder::create()
7+
->in(__DIR__)
8+
->exclude([
9+
'.git/',
10+
'node_modules/',
11+
'vendor/',
12+
])
13+
->name('*.php');
14+
15+
$config = new Config();
16+
17+
$rules = [
18+
'@PER-CS2.0' => true,
19+
];
20+
21+
return $config
22+
->setRules($rules)
23+
->setFinder($finder)
24+
->setCacheFile(sys_get_temp_dir() . '/php-cs-fixer.advancedforms.cache')
25+
;

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"php": ">=8.2"
44
},
55
"require-dev": {
6+
"friendsofphp/php-cs-fixer": "^3.86",
67
"glpi-project/tools": "^0.4"
78
},
89
"config": {

setup.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ function plugin_version_advancedforms()
6868
'glpi' => [
6969
'min' => PLUGIN_ADVANCEDFORMS_MIN_GLPI_VERSION,
7070
'max' => PLUGIN_ADVANCEDFORMS_MAX_GLPI_VERSION,
71-
]
72-
]
71+
],
72+
],
7373
];
7474
}
7575

0 commit comments

Comments
 (0)