-
Notifications
You must be signed in to change notification settings - Fork 0
/
.php-cs-fixer.php
executable file
·63 lines (60 loc) · 2.81 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
<?php declare(strict_types = 1);
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$finder = Finder::create()
->in(dirs: [getcwd(), ])
->exclude(dirs: ['vendor', 'var', '.github', ]);
return (new Config())
->setRules(rules: [
'@PER' => true,
'@PER:risky' => true,
'@PHP80Migration:risky' => true,
'@PHP81Migration' => true,
'@PHP82Migration' => true,
'@Symfony' => true,
'@Symfony:risky' => true,
'binary_operator_spaces' => true,
'blank_line_after_opening_tag' => false,
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'comment_to_phpdoc' => true,
'concat_space' => ['spacing' => 'one', ],
'date_time_create_from_format_call' => true,
'declare_equal_normalize' => ['space' => 'single', ],
'declare_strict_types' => true,
'explicit_indirect_variable' => true,
'fopen_flags' => ['b_mode' => true, ],
'global_namespace_import' => ['import_constants' => null, 'import_functions' => true, 'import_classes' => true, ],
'increment_style' => ['style' => 'post', ],
'linebreak_after_opening_tag' => false,
'magic_constant_casing' => true,
'method_chaining_indentation' => false,
'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line', ],
'native_constant_invocation' => false,
'native_function_invocation' => false,
'native_function_type_declaration_casing' => true,
'no_alias_functions' => ['sets' => ['@all', ], ],
'no_blank_lines_after_class_opening' => true,
'no_superfluous_elseif' => true,
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true, 'remove_inheritdoc' => true, ],
'no_trailing_comma_in_singleline' => ['elements' => [], ],
'no_unneeded_curly_braces' => true,
'no_unset_on_property' => true,
'no_useless_else' => true,
'no_useless_sprintf' => true,
'nullable_type_declaration_for_default_null_value' => ['use_nullable_type_declaration' => true, ],
'ordered_class_elements' => ['sort_algorithm' => 'none', ],
'ordered_imports' => ['sort_algorithm' => 'alpha', 'imports_order' => ['class', 'function', 'const', ], ],
'protected_to_private' => false,
'return_assignment' => true,
'simple_to_complex_string_variable' => true,
'single_line_throw' => true,
'strict_comparison' => true,
'strict_param' => true,
'trailing_comma_in_multiline' => ['elements' => ['arrays', 'arguments', 'parameters', 'match', ], ],
'types_spaces' => ['space' => 'none', ],
'yoda_style' => true,
], )
->setRiskyAllowed(isRiskyAllowed: true, )
->setCacheFile(cacheFile: getcwd() . '.php-cs-fixer.cache', )
->setFinder(finder: $finder);