-
Notifications
You must be signed in to change notification settings - Fork 0
/
.php-cs-fixer.php
93 lines (88 loc) · 3.46 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
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
<?php
/**
* To strictly follow the PSRs.
*
* @see source https://gist.github.com/srbrunoferreira/5b0d96955c3913f6b1cd805c2a14079d
* @see rules https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/rules/index.rst
* @see php-cs-fixer rule sets https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/ruleSets/index.rst
*/
return (new PhpCsFixer\Config())
->setRules([
'@PSR12' => true,
'@PSR2' => true,
'@PSR1' => true,
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'combine_consecutive_unsets' => true,
'class_attributes_separation' => ['elements' => ['method' => 'one']],
'multiline_whitespace_before_semicolons' => false,
'single_quote' => true,
'visibility_required' => true,
'ordered_imports' => ['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'none'],
'binary_operator_spaces' => [
'operators' => []
],
'braces' => [
'allow_single_line_closure' => true,
],
'concat_space' => ['spacing' => 'one'],
'declare_equal_normalize' => true,
'function_typehint_space' => true,
'single_line_comment_style' => ['comment_types' => ['hash']],
'include' => true,
'lowercase_cast' => true,
'lowercase_static_reference' => true,
'native_function_casing' => true,
'no_blank_lines_before_namespace' => false,
'no_empty_phpdoc' => true,
'no_empty_statement' => true,
'no_extra_blank_lines' => [
'tokens' => [
'curly_brace_block',
'extra',
'throw',
'use',
]
],
'no_multiline_whitespace_around_double_arrow' => true,
'no_spaces_around_offset' => true,
'no_trailing_comma_in_list_call' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_unused_imports' => true,
'no_whitespace_before_comma_in_array' => true,
'no_whitespace_in_blank_line' => true,
'object_operator_without_whitespace' => true,
'phpdoc_align' => ['align' => 'vertical'],
'phpdoc_no_empty_return' => false,
'phpdoc_no_useless_inheritdoc' => true,
'phpdoc_scalar' => true,
'phpdoc_separation' => false,
'phpdoc_trim' => true,
'phpdoc_types' => true,
'return_type_declaration' => true,
'short_scalar_cast' => true,
'single_blank_line_before_namespace' => true,
'ternary_operator_spaces' => true,
'trailing_comma_in_multiline' => ['elements' => [], 'after_heredoc' => false],
'single_trait_insert_per_statement' => true,
'single_import_per_statement' => ['group_to_single_imports' => false],
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'whitespace_after_comma_in_array' => true,
'space_after_semicolon' => true,
'single_blank_line_at_eof' => true,
'yoda_style' => [
'always_move_variable' => false,
'equal' => false,
'identical' => false,
'always_move_variable' => false,
],
// Risk
'strict_comparison' => false,
'declare_strict_types' => false,
'strict_param' => false
])
->setIndent(' ')
->setLineEnding("\n")
->setRiskyAllowed(true)
;