-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
php_cs.php.dist
98 lines (96 loc) · 3.11 KB
/
php_cs.php.dist
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
<?php
$finder = PhpCsFixer\Finder::create()
->exclude('vendor')
->in(__DIR__)
;
$config = new PhpCsFixer\Config();
return $config->setRules([
'align_multiline_comment' => [
'comment_type' => 'phpdocs_only'
],
'array_indentation' => [],
'array_syntax' => [
'syntax' => 'short'
],
'binary_operator_spaces' => [
'default' => 'single_space'
],
'blank_line_before_statement' => [
'statements' => [
'if','return','while','for','foreach','do'
]
],
'indentation_type' => true,
'method_chaining_indentation' => true,
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,
'blank_line_after_opening_tag' => true,
'blank_line_after_namespace' => true,
'elseif' => false,
'explicit_string_variable' => false,
'full_opening_tag' => true,
'fully_qualified_strict_types' => true,
'line_ending' => true,
'linebreak_after_opening_tag' => true,
'lowercase_cast' => true,
'lowercase_keywords' => true,
'lowercase_static_reference' => true,
'no_alternative_syntax' => true,
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'no_blank_lines_before_namespace' => true,
'no_closing_tag' => true,
'no_empty_comment' => true,
'no_empty_phpdoc' => true,
'no_empty_statement' => true,
'no_multiline_whitespace_around_double_arrow' => true,
'no_spaces_after_function_name' => true,
'no_spaces_inside_parenthesis' => true,
'no_unused_imports' => true,
'single_import_per_statement' => true,
'single_blank_line_at_eof' => true,
'no_whitespace_in_blank_line' => true,
'not_operator_with_space' => false,
'ordered_imports' => [
'sort_algorithm' => 'alpha'
],
'ordered_class_elements' => [
'sort_algorithm' => 'alpha',
'order' => [
'constant_public',
'constant_protected',
'constant_private',
'property_public',
'property_protected',
'property_private',
'construct',
'method_public',
'method_private'
]
],
'no_mixed_echo_print' => [
'use' => 'echo'
],
'constant_case' => [
'case' => 'lower'
],
'increment_style' => [
'style' => 'post'
],
'concat_space' => [
'spacing' => 'none'
],
'braces' => [
'allow_single_line_closure' => false,
'position_after_functions_and_oop_constructs' => 'same',
'position_after_anonymous_constructs' => 'next',
'position_after_control_structures' => 'same'
],
'class_definition' => [
'single_line' => true
]
])
->setIndent(" ")
->setLineEnding("\n")
->setFinder($finder)
;