-
Notifications
You must be signed in to change notification settings - Fork 1
/
.php-cs-fixer.php
122 lines (116 loc) · 4.25 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?php
$finder = PhpCsFixer\Finder::create()
->in(__DIR__ . '/app')
->in(__DIR__ . '/config')
->in(__DIR__ . '/routes')
->in(__DIR__ . '/config')
->in(__DIR__ . '/database')
->name('*.php')
->ignoreDotFiles(true)
->ignoreVCS(true);
$config = new PhpCsFixer\Config;
$config
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
->setRules([
'@Symfony' => true,
'yoda_style' => false,
'phpdoc_order' => true,
'new_with_braces' => false,
'short_scalar_cast' => true,
'phpdoc_to_comment' => false,
'single_line_throw' => false,
'single_line_empty_body' => true,
'single_blank_line_at_eof' => true,
'no_superfluous_phpdoc_tags' => false,
'linebreak_after_opening_tag' => true,
'class_attributes_separation' => false,
'blank_line_between_import_groups' => false,
'not_operator_with_successor_space' => false,
'single_trait_insert_per_statement' => false,
'nullable_type_declaration_for_default_null_value' => true,
'concat_space' => [
'spacing' => 'one',
],
'array_syntax' => [
'syntax' => 'short',
],
'ordered_types' => [
'sort_algorithm' => 'none',
'null_adjustment' => 'always_last',
],
'ordered_imports' => [
'imports_order' => ['class', 'const', 'function'],
'sort_algorithm' => 'length',
],
'cast_spaces' => [
'space' => 'none',
],
'new_with_parentheses' => [
'named_class' => false,
'anonymous_class' => false,
],
'curly_braces_position' => [
'anonymous_classes_opening_brace' => 'next_line_unless_newline_at_signature_end',
],
'align_multiline_comment' => [
'comment_type' => 'phpdocs_like',
],
'global_namespace_import' => [
'import_classes' => null,
'import_constants' => null,
'import_functions' => true,
],
'type_declaration_spaces' => [
'elements' => [],
],
'nullable_type_declaration' => [
'syntax' => 'question_mark',
],
'attribute_empty_parentheses' => [
'use_parentheses' => false,
],
'trailing_comma_in_multiline' => [
'elements' => ['arrays', 'arguments', 'parameters', 'match'],
],
'phpdoc_align' => [
'align' => 'vertical',
'tags' => [
'param',
'property',
'property-read',
'property-write',
'return',
'throws',
'type',
'var',
'method',
],
],
'increment_style' => [
'style' => 'post',
],
'phpdoc_no_alias_tag' => [
'replacements' => [
'type' => 'var',
'link' => 'see',
],
],
'no_extra_blank_lines' => [
'tokens' => [],
],
'function_declaration' => [
'closure_function_spacing' => 'one',
],
'binary_operator_spaces' => [
'operators' => [
'|' => null,
'=' => 'align_single_space',
'=>' => 'align_single_space',
],
],
'fully_qualified_strict_types' => [
'phpdoc_tags' => [],
],
])
->setFinder($finder);
return $config;