-
Notifications
You must be signed in to change notification settings - Fork 0
/
.phpcs.dist
105 lines (102 loc) · 3.51 KB
/
.phpcs.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
99
100
101
102
103
104
<?php
$finder = PhpCsFixer\Finder::create()
->in([
__DIR__.'/app',
__DIR__.'/tests',
__DIR__.'/database',
]);
return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
'array_push' => true,
'no_multiline_whitespace_around_double_arrow' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_whitespace_before_comma_in_array' => true,
'trim_array_spaces' => true,
'no_trailing_comma_in_singleline' => true,
'cast_spaces' => ['space' => 'single'],
'lowercase_cast' => true,
'modernize_types_casting' => true,
'array_syntax' => ['syntax' => 'short'],
'no_unused_imports' => true,
'no_extra_blank_lines' => true,
'blank_line_after_opening_tag' => true,
'ordered_traits' => true,
'protected_to_private' => true,
'self_accessor' => true,
'no_superfluous_elseif' => true,
'no_useless_else' => true,
'simplified_if_return' => true,
'elseif' => true,
'void_return' => true,
'global_namespace_import' => true,
'no_useless_nullsafe_operator' => true,
'ternary_to_null_coalescing' => true,
'single_quote' => true,
'blank_line_before_statement' => [
'statements' => [
'continue',
'declare',
'default',
'exit',
'do',
'exit',
'for',
'foreach',
'goto',
'if',
'include',
'include_once',
'require',
'require_once',
'return',
'switch',
'throw',
'try',
'while',
'yield',
],
],
'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'],
'braces' => ['allow_single_line_closure' => true],
'compact_nullable_typehint' => true,
'concat_space' => ['spacing' => 'one'],
'declare_equal_normalize' => ['space' => 'none'],
'function_typehint_space' => true,
'new_with_braces' => true,
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
'no_empty_statement' => true,
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_whitespace_in_blank_line' => true,
'return_type_declaration' => ['space_before' => 'none'],
'single_trait_insert_per_statement' => true,
'class_attributes_separation' => ['elements' => ['method' => 'one']],
'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',
'destruct',
'magic',
'phpunit',
'method_public_static',
'method_protected_static',
'method_private_static',
'method_public',
'method_protected',
'method_private',
],
],
])
->setFinder($finder);