-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.php-cs-fixer.php
More file actions
108 lines (105 loc) · 3.39 KB
/
Copy path.php-cs-fixer.php
File metadata and controls
108 lines (105 loc) · 3.39 KB
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
<?php
$finder = PhpCsFixer\Finder::create()
->in('examples/')
->in('src/')
->in('tests/')
;
return (new PhpCsFixer\Config())
->setRules([
'@PSR12' => true,
'@PER-CS3x0' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'simplified_if_return' => true,
'no_superfluous_phpdoc_tags' => true,
'single_class_element_per_statement' => true,
'class_attributes_separation' => [
'elements' => [
'property' => 'none',
'method' => 'one'
]
],
'array_syntax' => [
'syntax' => 'short'
],
'binary_operator_spaces' => [
'operators' => ['=' => 'align']
],
'blank_line_after_namespace' => true,
'blank_line_before_statement' => [
'statements' => ['declare', 'return']
],
'blank_line_between_import_groups' => true,
'concat_space' => [
'spacing' => 'one'
],
'constant_case' => true,
'braces_position' => [
'functions_opening_brace' => 'next_line_unless_newline_at_signature_end',
'allow_single_line_empty_anonymous_classes' => true,
'allow_single_line_anonymous_functions' => true
],
'declare_equal_normalize' => [
'space' => 'none'
],
'elseif' => true,
'encoding' => true,
'full_opening_tag' => true,
'line_ending' => true,
'lowercase_cast' => true,
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
'keep_multiple_spaces_after_comma' => false,
],
'trailing_comma_in_multiline' => [
'elements' => ['parameters'],
],
'multiline_comment_opening_closing' => true,
'no_break_comment' => false,
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,
'no_whitespace_in_blank_line' => true,
'return_type_declaration' => [
'space_before' => 'none',
],
'single_blank_line_at_eof' => true,
'strict_param' => false,
'modifier_keywords' => [
'elements' => ['const', 'method', 'property']
],
'no_unused_imports' => true,
'ordered_imports' => [
'sort_algorithm' => 'alpha'
],
'ternary_operator_spaces' => true,
'ordered_class_elements' => [
'order' => [
'use_trait',
'case',
'constant_public',
'constant_protected',
'constant_private',
'property_public_static',
'property_protected_static',
'property_private_static',
'property_public',
'property_protected',
'property_private',
'construct',
'method_public_static',
'method_protected_static',
'method_private_static',
'method_public',
'method_protected',
'method_private',
'magic',
],
'sort_algorithm' => 'alpha',
]
])
->setIndent(" ")
->setFinder($finder)
->setLineEnding("\n")
->setUsingCache(true)
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
;