-
Notifications
You must be signed in to change notification settings - Fork 0
/
.php_cs
84 lines (77 loc) · 2.19 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
84
<?php
// https://mlocati.github.io/php-cs-fixer-configurator/
$rules = [
'@PSR2' => true,
// Arrays
'array_syntax' => [
'syntax' => 'short',
],
'trim_array_spaces' => true,
'no_whitespace_before_comma_in_array' => true,
'whitespace_after_comma_in_array' => true,
'no_trailing_comma_in_singleline_array' => true,
'trailing_comma_in_multiline_array' => true,
'not_operator_with_successor_space' => true,
// General
'indentation_type' => true,
'single_quote' => true,
'no_unused_imports' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'no_extra_blank_lines' => true,
'no_whitespace_in_blank_line' => true,
'linebreak_after_opening_tag' => true,
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'cast_spaces' => true,
'concat_space' => [
'spacing' => 'none',
],
'blank_line_before_statement' => true,
'method_chaining_indentation' => true,
'ordered_imports' => [
'sort_algorithm' => 'alpha',
],
'single_line_comment_style' => [
'comment_types' => [
'hash',
],
],
'return_type_declaration' => [
'space_before' => 'none',
],
// Docs
'phpdoc_types' => true,
'phpdoc_indent' => true,
'phpdoc_to_comment' => true,
'phpdoc_trim' => true,
'phpdoc_align' => true,
'phpdoc_summary' => true,
'phpdoc_separation' => true,
'phpdoc_scalar' => true,
'phpdoc_order' => true,
'phpdoc_inline_tag' => true,
'phpdoc_return_self_reference' => true,
'phpdoc_var_without_name' => true,
'phpdoc_var_annotation_correct_order' => true,
'phpdoc_trim_consecutive_blank_line_separation' => true,
'phpdoc_add_missing_param_annotation' => [
'only_untyped' => false,
],
];
$excludes = [
'coverage',
'docs',
'vendor',
];
return PhpCsFixer\Config::create()
->setRules($rules)
->setFinder(
PhpCsFixer\Finder::create()
->exclude($excludes)
->in(__DIR__.'/config')
->in(__DIR__.'/src')
->in(__DIR__.'/tests')
->ignoreDotFiles(true)
->ignoreVCS(true)
);