-
Notifications
You must be signed in to change notification settings - Fork 3
/
.php_cs
51 lines (50 loc) · 1.58 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
<?php
return PhpCsFixer\Config::create()
->setRules([
'@PSR2' => true,
'binary_operator_spaces' => true,
'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' => true,
'no_blank_lines_after_class_opening' => true,
'no_leading_import_slash' => true,
'no_whitespace_in_blank_line' => true,
'ordered_class_elements' => [
'order' => [
'use_trait',
],
],
'ordered_imports' => [
'imports_order' => [
'class',
'function',
'const',
],
'sort_algorithm' => 'none',
],
'return_type_declaration' => true,
'short_scalar_cast' => true,
'single_blank_line_before_namespace' => true,
'single_trait_insert_per_statement' => true,
'ternary_operator_spaces' => true, //标准化三元运算的格式
'unary_operator_spaces' => true,
'visibility_required' => [
'elements' => [
'const',
'method',
'property',
],
],
'array_indentation' => true, //数组的每个元素必须缩进一次
'psr4' => true,
])
->setFinder(
PhpCsFixer\Finder::create()
->exclude('vendor')
->in([__DIR__.'/src/', __DIR__.'/tests/'])
)
;