-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphp-cs-fixer.php
More file actions
88 lines (86 loc) · 2.91 KB
/
php-cs-fixer.php
File metadata and controls
88 lines (86 loc) · 2.91 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
declare(strict_types=1);
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;
// Help on rules -> https://cs.symfony.com/doc/rules/index.html
return (new Config())
->setParallelConfig(ParallelConfigFactory::detect())
->setCacheFile('/tmp/.php-cs-fixer.php.cache')
->setRiskyAllowed(true)
->setRules([
// Import rule sets
'@Symfony' => true,
'@Symfony:risky' => true,
// Custom rules
'binary_operator_spaces' => [
'operators' => [
'=>' => 'align',
],
],
'blank_line_after_opening_tag' => false,
'combine_consecutive_unsets' => true,
'concat_space' => [
'spacing' => 'one',
],
'declare_strict_types' => true,
'explicit_indirect_variable' => true,
'function_declaration' => [
'closure_function_spacing' => 'none',
'closure_fn_spacing' => 'none',
],
'global_namespace_import' => [
'import_classes' => true,
],
'heredoc_to_nowdoc' => true,
'native_constant_invocation' => [
'fix_built_in' => false,
'strict' => true,
],
'native_function_invocation' => [
'include' => [],
],
'no_extra_blank_lines' => [
'tokens' => [
'attribute',
'break',
'case',
'continue',
'curly_brace_block',
'default',
'extra',
'parenthesis_brace_block',
'return',
'square_brace_block',
'switch',
'throw',
'use',
],
],
'no_superfluous_phpdoc_tags' => false,
'no_trailing_whitespace_in_string' => false,
'no_useless_else' => true,
'no_useless_return' => true,
'phpdoc_summary' => false,
'return_assignment' => true,
'self_accessor' => false,
'self_static_accessor' => true,
'single_line_throw' => false,
'ternary_to_null_coalescing' => true,
'void_return' => true,
'yoda_style' => [
'always_move_variable' => false,
'equal' => null,
'identical' => null,
'less_and_greater' => null,
],
])
->setFinder(
Finder::create()
->exclude([
'vendor',
'var',
'_data',
])
->in(__DIR__)
);