-
Notifications
You must be signed in to change notification settings - Fork 1
/
.php-cs-fixer.php
51 lines (47 loc) · 1.38 KB
/
.php-cs-fixer.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
/**
* Copyright (c) Dimitri BOUTEILLE (https://github.com/dimitriBouteille)
* See LICENSE.txt for license details.
*
* Author: Dimitri BOUTEILLE <[email protected]>
*/
$finder = \PhpCsFixer\Finder::create()
->name('*.php')
->in([
'src',
])
->exclude([
__DIR__ . '/tests/fixtures',
])
;
$header = <<<EOF
Copyright (c) Dimitri BOUTEILLE (https://github.com/dimitriBouteille)
See LICENSE.txt for license details.
Author: Dimitri BOUTEILLE <[email protected]>
EOF;
$config = new \PhpCsFixer\Config();
return $config
->setFinder($finder)
->setCacheFile(__DIR__ . '/var/.php-cs-fixer.cache')
->setRiskyAllowed(true)
->setRules([
'@PSR12' => true,
'@PHP81Migration' => true,
'strict_param' => true,
'array_syntax' => ['syntax' => 'short'],
'octal_notation' => false,
'trim_array_spaces' => true,
'phpdoc_order' => true,
'ordered_imports' => true,
'new_with_parentheses' => true,
'method_chaining_indentation' => true,
'no_unused_imports' => true,
'align_multiline_comment' => true,
'array_indentation' => true,
'header_comment' => [
'header' => $header,
'comment_type' => 'PHPDoc',
'location' => 'after_open',
'separate' => 'bottom',
],
]);