-
Notifications
You must be signed in to change notification settings - Fork 15
/
.php-cs-fixer.php
78 lines (72 loc) · 2.95 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
<?php
$finder = PhpCsFixer\Finder::create()
->files()
->name('*.php')
->in(__DIR__ . '/')
->exclude('Resources/config')
->exclude('src/DependencyInjection')
->exclude('test_e2e')
;
$config = new PhpCsFixer\Config();
$config->setRiskyAllowed(true)
->setRules(
[
'@DoctrineAnnotation' => true,
'@Symfony' => true,
'@Symfony:risky' => true,
// @Symfony code styles rules blacklisting:
'method_chaining_indentation' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_trailing_comma_in_list_call' => false,
'php_unit_fqcn_annotation' => false,
'phpdoc_align' => false,
'phpdoc_annotation_without_dot' => false,
'phpdoc_indent' => false,
'phpdoc_inline_tag_normalizer' => false,
'phpdoc_no_access' => false,
'phpdoc_no_alias_tag' => false,
'phpdoc_no_empty_return' => false,
'phpdoc_no_package' => false,
'phpdoc_no_useless_inheritdoc' => false,
'phpdoc_return_self_reference' => false,
'phpdoc_scalar' => false,
'phpdoc_separation' => false,
'phpdoc_single_line_var_spacing' => false,
'phpdoc_summary' => false,
'phpdoc_to_comment' => false,
'phpdoc_trim' => false,
'phpdoc_types' => false,
'phpdoc_var_without_name' => false,
'error_suppression' => false,
'standardize_not_equals' => false,
// @Symfony customised rules
'concat_space' => ['spacing' => 'one'],
'native_function_invocation' => false,
'single_quote' => ['strings_containing_single_quote_chars' => true],
'visibility_required' => ['elements' => ['property', 'method', 'const']],
'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false],
// Additional code style rules whitelisting:
'align_multiline_comment' => true,
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'combine_consecutive_issets' => true,
'declare_strict_types' => true,
'explicit_indirect_variable' => true,
'explicit_string_variable' => true,
'fully_qualified_strict_types' => true,
'linebreak_after_opening_tag' => true,
'list_syntax' => ['syntax' => 'short'],
'mb_str_functions' => true,
'multiline_comment_opening_closing' => true,
'multiline_whitespace_before_semicolons' => ['strategy' => 'new_line_for_chained_calls'],
'no_alternative_syntax' => true,
'no_superfluous_elseif' => true,
'ordered_imports' => true,
'ordered_interfaces' => true,
]
)
->setRiskyAllowed(true)
->setFinder($finder)
->setUsingCache(false)
;
return $config;