-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy path.php-cs-fixer.dist.php
101 lines (98 loc) · 4.65 KB
/
.php-cs-fixer.dist.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
<?php
declare(strict_types=1);
$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude('bin')
->exclude('config')
->exclude('docker')
->exclude('fixtures')
->exclude('templates')
->exclude('translations')
->exclude('var')
->notPath('public/index.php')
;
return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->registerCustomFixers(new PhpCsFixerCustomFixers\Fixers())
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
'doctrine_annotation_array_assignment' => ['operator' => '='],
'doctrine_annotation_braces' => ['syntax' => 'with_braces'],
'align_multiline_comment' => true,
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'class_definition' => ['single_line' => false],
'class_reference_name_casing' => true,
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'compact_nullable_typehint' => true,
'concat_space' => ['spacing' => 'one'],
'declare_strict_types' => true,
'echo_tag_syntax' => ['format' => 'long'],
'general_phpdoc_annotation_remove' => ['annotations' => ['author']],
'linebreak_after_opening_tag' => true,
'mb_str_functions' => true,
'multiline_comment_opening_closing' => true,
'multiline_whitespace_before_semicolons' => ['strategy' => 'new_line_for_chained_calls'],
'no_alternative_syntax' => true,
'no_null_property_initialization' => true,
'no_php4_constructor' => true,
'no_superfluous_elseif' => true,
'no_superfluous_phpdoc_tags' => true,
'no_unreachable_default_argument_value' => true,
'no_unset_on_property' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'no_useless_sprintf' => true,
'ordered_class_elements' => true,
'ordered_imports' => true,
'php_unit_dedicate_assert' => true,
'php_unit_strict' => true,
'php_unit_set_up_tear_down_visibility' => true,
'phpdoc_add_missing_param_annotation' => false,
'phpdoc_order' => true,
'phpdoc_trim_consecutive_blank_line_separation' => true,
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
'pow_to_exponentiation' => true,
'random_api_migration' => true,
'return_assignment' => true,
'self_accessor' => false,
'semicolon_after_instruction' => true,
'simplified_null_return' => true,
'single_line_throw' => true,
'strict_comparison' => true,
'strict_param' => true,
'string_line_ending' => true,
'ternary_to_null_coalescing' => true,
'types_spaces' => false,
'void_return' => true,
'yoda_style' => [
'equal' => false,
'identical' => false,
'less_and_greater' => false,
],
PhpCsFixerCustomFixers\Fixer\CommentSurroundedBySpacesFixer::name() => true,
PhpCsFixerCustomFixers\Fixer\DataProviderNameFixer::name() => true,
PhpCsFixerCustomFixers\Fixer\DataProviderReturnTypeFixer::name() => true,
PhpCsFixerCustomFixers\Fixer\NoDuplicatedImportsFixer::name() => true,
PhpCsFixerCustomFixers\Fixer\MultilineCommentOpeningClosingAloneFixer::name() => true,
PhpCsFixerCustomFixers\Fixer\NoCommentedOutCodeFixer::name() => true,
PhpCsFixerCustomFixers\Fixer\NoDoctrineMigrationsGeneratedCommentFixer::name() => true,
PhpCsFixerCustomFixers\Fixer\NoImportFromGlobalNamespaceFixer::name() => true,
PhpCsFixerCustomFixers\Fixer\NoLeadingSlashInGlobalNamespaceFixer::name() => true,
PhpCsFixerCustomFixers\Fixer\NoPhpStormGeneratedCommentFixer::name() => true,
PhpCsFixerCustomFixers\Fixer\NoReferenceInFunctionDefinitionFixer::name() => true,
PhpCsFixerCustomFixers\Fixer\NoSuperfluousConcatenationFixer::name() => true,
PhpCsFixerCustomFixers\Fixer\NoUselessCommentFixer::name() => true,
PhpCsFixerCustomFixers\Fixer\NoUselessDoctrineRepositoryCommentFixer::name() => true,
PhpCsFixerCustomFixers\Fixer\PhpdocNoSuperfluousParamFixer::name() => true,
PhpCsFixerCustomFixers\Fixer\PhpdocParamOrderFixer::name() => true,
PhpCsFixerCustomFixers\Fixer\PhpdocParamTypeFixer::name() => true,
PhpCsFixerCustomFixers\Fixer\PhpUnitNoUselessReturnFixer::name() => true,
PhpCsFixerCustomFixers\Fixer\SingleSpaceAfterStatementFixer::name() => true,
PhpCsFixerCustomFixers\Fixer\SingleSpaceBeforeStatementFixer::name() => true,
])
->setFinder($finder)
->setCacheFile(__DIR__.'/var/.php_cs.cache')
;