-
Notifications
You must be signed in to change notification settings - Fork 16
/
.php_cs
83 lines (77 loc) · 3.12 KB
/
.php_cs
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
<?php
$rules = [
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => ['sortAlgorithm' => 'alpha'],
'no_unused_imports' => true,
'binary_operator_spaces' => ['default' => 'align_single_space_minimal'],
'blank_line_after_opening_tag' => true,
'blank_line_before_statement' => true,
'class_attributes_separation' => ['elements' => ['method', 'property']],
'concat_space' => ['spacing' => 'one'],
'declare_equal_normalize' => ['space' => 'single'],
// 'dir_constant' => true, // risky
'fully_qualified_strict_types' => true,
'function_declaration' => ['closure_function_spacing' => 'none'],
'function_typehint_space' => true,
'include' => true,
// 'is_null' => true,
'list_syntax' => ['syntax' => 'short'],
'lowercase_cast' => true,
'lowercase_static_reference' => true,
'magic_constant_casing' => true,
'method_separation' => true,
'method_chaining_indentation' => true,
// 'modernize_types_casting' => true
'native_function_casing' => true,
'normalize_index_brace' => true,
'object_operator_without_whitespace' => true,
'phpdoc_align' => true,
'phpdoc_annotation_without_dot' => true,
'phpdoc_indent' => true,
'phpdoc_inline_tag' => true,
'phpdoc_no_access' => true,
// 'phpdoc_no_package' => true,
'phpdoc_no_empty_return' => true,
'phpdoc_no_useless_inheritdoc' => true,
'phpdoc_return_self_reference' => true,
'phpdoc_scalar' => true,
'phpdoc_separation' => true,
'phpdoc_single_line_var_spacing' => true,
'phpdoc_to_comment' => true,
'phpdoc_trim' => true,
'phpdoc_types' => true,
'phpdoc_var_without_name' => true,
'return_type_declaration' => true,
'short_scalar_cast' => true,
'single_blank_line_before_namespace' => true,
// 'single_line_comment_style' => true,
'single_quote' => true,
'space_after_semicolon' => true,
'standardize_not_equals' => true,
'ternary_operator_spaces' => true,
'ternary_to_null_coalescing' => true,
'trailing_comma_in_multiline_array' => true,
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'whitespace_after_comma_in_array' => true,
];
$excludes = [
'bootstrap',
'vendor',
'storage',
'node_modules',
'resources',
'public',
];
$finder = Symfony\Component\Finder\Finder::create()
->in(__DIR__)
->exclude($excludes)
->name('*.php')
->notName('_ide_helper')
->notName('*.blade.php')
->ignoreDotFiles(true)
->ignoreVCS(true);
return PhpCsFixer\Config::create()
->setRules($rules)
->setFinder($finder);