-
Notifications
You must be signed in to change notification settings - Fork 0
/
.php-cs-fixer.php
77 lines (77 loc) · 2.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
<?php
return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
'@DoctrineAnnotation' => true,
'binary_operator_spaces' => true,
'blank_line_before_statement' => [
'statements' => [
'declare',
],
],
'blank_line_after_opening_tag' => true,
'compact_nullable_typehint' => true,
'declare_equal_normalize' => true,
'lowercase_cast' => true,
'lowercase_static_reference' => true,
'new_with_braces' => true,
'no_unused_imports' => false,
'no_blank_lines_after_class_opening' => true,
'no_leading_import_slash' => true,
'no_whitespace_in_blank_line' => true,
'single_trait_insert_per_statement' => false,
'ordered_class_elements' => [
'order' => [
'use_trait',
],
],
'ordered_imports' => [
'imports_order' => [
'class', 'function', 'const',
],
'sort_algorithm' => 'none',
],
'list_syntax' => [
'syntax' => 'short'
],
'phpdoc_align' => [
'align' => 'left',
],
'constant_case' => [
'case' => 'lower',
],
'return_type_declaration' => true,
'short_scalar_cast' => true,
'single_blank_line_before_namespace' => true,
'ternary_operator_spaces' => true,
'unary_operator_spaces' => true,
'visibility_required' => [
'elements' => [
'const',
'method',
'property',
],
],
'combine_consecutive_unsets' => true,
'linebreak_after_opening_tag' => true,
'phpdoc_separation' => false,
'single_quote' => true,
'standardize_not_equals' => true,
'multiline_comment_opening_closing' => true,
'ternary_to_null_coalescing' => true,
//'declare_strict_types' => true,//激进,强制打开严格模式
])->setFinder(
PhpCsFixer\Finder::create()
->exclude('bootstrap')
->exclude('config')
->exclude('database')
->exclude('lang')
->exclude('node_modules')
->exclude('public')
->exclude('storage')
->exclude('vendor')
->exclude('resources')
->exclude('routes')
->in(__DIR__)
)->setUsingCache(false);