-
Notifications
You must be signed in to change notification settings - Fork 0
/
.php-cs-fixer.dist.php
115 lines (110 loc) · 3.39 KB
/
.php-cs-fixer.dist.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?php
declare(strict_types=1);
use PedroTroller\CS\Fixer\Fixers;
use PedroTroller\CS\Fixer\RuleSetFactory;
use PhpCsFixer\Finder;
$finder = Finder::create()
->ignoreVCS(true)
->ignoreDotFiles(true)
->in(__DIR__)
->append([__FILE__])
;
$config = new PhpCsFixer\Config();
$config->setRiskyAllowed(true);
$config->setUsingCache(true);
$config->registerCustomFixers(new Fixers());
$config->setFinder($finder);
$config->setRules(
RuleSetFactory::create()
->php(8.3, true)
->phpCsFixer(true)
->pedrotroller(true)
->enable('PedroTroller/line_break_between_method_arguments', [
'max-length' => 80,
])
->enable('align_multiline_comment')
->enable('array_indentation')
->enable('binary_operator_spaces', [
'operators' => [
'=' => 'align_single_space_minimal',
'=>' => 'align_single_space_minimal',
],
])
->enable('class_attributes_separation', [
'elements' => [
'const' => 'one',
'method' => 'one',
'property' => 'one',
],
])
->enable('class_definition', [
'single_line' => true,
'inline_constructor_arguments' => false,
])
->enable('fully_qualified_strict_types')
->enable('linebreak_after_opening_tag')
->enable('mb_str_functions')
->enable('native_function_invocation')
->enable('no_extra_blank_lines', [
'tokens' => [
'break',
'continue',
'curly_brace_block',
'default',
'extra',
'parenthesis_brace_block',
'return',
'square_brace_block',
'switch',
'throw',
'use',
],
])
->enable('no_superfluous_elseif')
->enable('no_superfluous_phpdoc_tags', [
'allow_mixed' => true,
])
->enable('no_useless_else')
->enable('ordered_class_elements')
->enable('ordered_imports')
->enable('phpdoc_order')
->enable('concat_space', ['spacing' => 'one'])
->enable('blank_line_before_statement', [
'statements' => [
'break',
'case',
'continue',
'declare',
'default',
'exit',
'goto',
'if',
'include',
'include_once',
'phpdoc',
'require',
'require_once',
'return',
'switch',
'throw',
'try',
'yield',
],
])
->enable('trailing_comma_in_multiline', [
'after_heredoc' => true,
'elements' => ['arguments', 'arrays', 'match', 'parameters'],
])
->enable('global_namespace_import', [
'import_classes' => true,
'import_constants' => false,
'import_functions' => false,
])
->disable('PedroTroller/exceptions_punctuation')
->disable('phpdoc_add_missing_param_annotation')
->disable('phpdoc_to_comment')
->disable('return_assignment')
->disable('strict_comparison')
->getRules(),
);
return $config;