-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.php_cs.dist
81 lines (75 loc) · 3.37 KB
/
.php_cs.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
<?php
$finder = PhpCsFixer\Finder::create()
// ->exclude('somedir')
->notPath('src/Symfony/Component/Translation/Tests/fixtures/resources.php')
->in(__DIR__ . '/src')
;
return PhpCsFixer\Config::create()
->setRules([
// '@PSR-2' => true,
// '@Symfony' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'align_double_arrow' => true, // \n after 'if', 'foreach' line...
'align_equals' => true, // \n after 'if', 'foreach' line...
],
'braces' => [
'position_after_control_structures' => 'same', // \n after 'if', 'foreach' line...
'position_before_control_structures' => 'previous', // \n after 'if', 'foreach' line...
],
'single_blank_line_before_namespace' => false,
// 'array_indentation' => true,
// 'method_argument_space' => ['ensure_fully_multiline' => true],
'no_short_bool_cast' => true,
'no_whitespace_in_blank_line' => true,
'not_operator_with_space' => true, // not_operator_with_successor_space
'phpdoc_to_comment' => true, // not_operator_with_successor_space
'align_multiline_comment' => true,
// 'multiline_comment_opening_closing' => true, // bugs with /**/ https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/4179
'no_short_echo_tag' => true,
'trailing_comma_in_multiline_array' => true,
'whitespace_after_comma_in_array' => true,
'yoda_style' => true,
// 'no_empty_comment' => true, // removes the /**/
// 'blank_line_before_return' => false,
'no_extra_blank_lines' => true,
// 'no_empty_statement' => true, // ???
// 'no_alternative_syntax' => true, // ???
// 'combine_consecutive_unsets' => false,
'object_operator_without_whitespace' => true,
'no_mixed_echo_print' => true,
'no_short_bool_cast' => true,
'no_singleline_whitespace_before_semicolons' => true,
'normalize_index_brace' => true,
'no_useless_return' => true,
'method_chaining_indentation' => true,
'no_spaces_around_offset' => [
'positions' => [
'outside', // inside spaces allowed for $var1[ $var2 ]
],
],
// psr2
'no_trailing_whitespace_in_comment' => true, // psr-2
'no_trailing_whitespace' => true, // psr-2
'blank_line_after_namespace' => true, // psr-2
'single_line_after_imports' => true, // psr-2
'single_import_per_statement' => true, // psr-2
'single_blank_line_at_eof' => true, // psr-2
'lowercase_constants' => true, // psr-2
'lowercase_keywords' => true, // psr-2
'no_break_comment' => true, // psr-2
'method_argument_space' => true, // psr-2, remove multiple spaces between args => break vertical alignment
'no_closing_tag' => true, // psr-2
'no_spaces_after_function_name' => true, // psr-2
// 'no_spaces_inside_parenthesis' => true, // psr-2
'single_class_element_per_statement' => true, // psr-2
'switch_case_semicolon_to_colon' => true, // psr-2
'switch_case_space' => true, // psr-2
'visibility_required' => true, // psr-2
])
->setFinder($finder)
;
// 'blank_line_after_opening_tag' => true,
// no_blank_lines_after_class_opening
// date_time_immutable
// no_useless_else