-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy path.php-cs-fixer.php
More file actions
72 lines (70 loc) · 2.24 KB
/
.php-cs-fixer.php
File metadata and controls
72 lines (70 loc) · 2.24 KB
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
<?php
$finder = PhpCsFixer\Finder::create()
->in(__DIR__ . '/src')
->in(__DIR__ . '/tests')
->exclude('vendor')
->name('*.php');
$config = new PhpCsFixer\Config();
return $config
->setRules([
'@PSR12' => true,
'@PSR12:risky' => true,
'declare_strict_types' => true,
'array_syntax' => ['syntax' => 'short'],
'blank_line_after_opening_tag' => true,
'blank_line_before_statement' => [
'statements' => ['throw', 'try']
],
'concat_space' => ['spacing' => 'one'],
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline'
],
'no_extra_blank_lines' => [
'tokens' => [
'curly_brace_block',
'extra',
'parenthesis_brace_block',
'square_brace_block',
'throw',
'use'
]
],
'no_spaces_after_function_name' => true,
'no_spaces_inside_parenthesis' => true,
'no_trailing_whitespace' => true,
'no_unused_imports' => true,
'ordered_imports' => [
'imports_order' => ['class', 'function', 'const'],
'sort_algorithm' => 'alpha'
],
'fully_qualified_strict_types' => [
'import_symbols' => true,
'leading_backslash_in_global_namespace' => false,
],
'phpdoc_align' => ['align' => 'left'],
'phpdoc_indent' => true,
'phpdoc_no_empty_return' => true,
'phpdoc_order' => [
'order' => ['param', 'return', 'throws']
],
'phpdoc_scalar' => true,
'phpdoc_separation' => [
'groups' => [
['param'],
['return', 'throws']
]
],
'phpdoc_summary' => true,
'phpdoc_to_comment' => true,
'phpdoc_trim' => true,
'single_blank_line_at_eof' => true,
'single_line_after_imports' => true,
'single_quote' => true,
'trailing_comma_in_multiline' => true,
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'whitespace_after_comma_in_array' => true,
])
->setFinder($finder)
->setRiskyAllowed(true)
->setUsingCache(true);