-
Notifications
You must be signed in to change notification settings - Fork 0
/
.php-cs-fixer.php
52 lines (48 loc) · 1.29 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
52
<?php
$rules = [
'@PSR12' => true,
'array_syntax' => ['syntax' => 'short'],
'multiline_whitespace_before_semicolons' => false,
'echo_tag_syntax' => false,
'no_unused_imports' => true,
'not_operator_with_successor_space' => true,
'no_useless_else' => true,
'ordered_imports' => ['sort_algorithm' => 'none', 'imports_order' => ['const', 'class', 'function']],
'phpdoc_add_missing_param_annotation' => true,
'phpdoc_indent' => true,
'phpdoc_no_package' => true,
'phpdoc_order' => true,
'phpdoc_separation' => true,
'phpdoc_single_line_var_spacing' => true,
'phpdoc_trim' => true,
'phpdoc_var_without_name' => true,
'phpdoc_to_comment' => true,
'single_quote' => true,
'ternary_operator_spaces' => true,
'trailing_comma_in_multiline' => true,
'trim_array_spaces' => true,
'curly_braces_position' => [
'classes_opening_brace' => 'same_line',
'functions_opening_brace' => 'same_line',
],
'visibility_required' => ['elements' => ['property', 'method']],
];
$excludes = [
'vendor',
'.vscode',
'.github',
'.devcontainer',
];
$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude($excludes)
->notName('README.md')
->notName('*.xml')
->notName('*.yml')
->notName('_ide_helper.php')
;
return (new PhpCsFixer\Config())
->setRules($rules)
->setFinder($finder)
->setIndent("\t")
;