-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.php-cs-fixer.php
77 lines (73 loc) · 2.45 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
<?php
use PhpCsFixer\Config;
$config = new Config();
$config->getFinder()->in([
__DIR__ . '/src',
__DIR__ . '/tests',
]);
return $config
->setRules([
'@PSR12' => true,
'@PHP80Migration' => true,
'no_unused_imports' => true,
'declare_strict_types' => true,
'phpdoc_add_missing_param_annotation' => [
'only_untyped' => true,
],
'self_accessor' => true,
'self_static_accessor' => true,
'no_unneeded_braces' => true,
'no_superfluous_elseif' => true,
'no_useless_else' => true,
'simplified_if_return' => true,
'yoda_style' => true,
'type_declaration_spaces' => true,
'lambda_not_used_import' => true,
'fully_qualified_strict_types' => true,
'global_namespace_import' => true,
'ordered_imports' => [
'sort_algorithm' => 'alpha',
'imports_order' => [
'class',
'function',
'const',
],
],
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'declare_parentheses' => true,
'explicit_indirect_variable' => true,
'single_space_around_construct' => true,
'no_leading_namespace_whitespace' => true,
'concat_space' => true,
'object_operator_without_whitespace' => true,
'operator_linebreak' => true,
'standardize_increment' => true,
'standardize_not_equals' => true,
'align_multiline_comment' => [
'comment_type' => 'all_multiline',
],
'general_phpdoc_tag_rename' => [
'replacements' => [
'inheritDocs' => 'inheritDoc',
],
],
'no_blank_lines_after_phpdoc' => true,
'no_empty_phpdoc' => true,
'phpdoc_align' => true,
'phpdoc_annotation_without_dot' => true,
'phpdoc_single_line_var_spacing' => true,
'no_useless_return' => true,
'return_assignment' => true,
'simplified_null_return' => true,
'explicit_string_variable' => true,
'single_quote' => true,
'array_indentation' => true,
'blank_line_before_statement' => true,
'method_chaining_indentation' => true,
'no_extra_blank_lines' => true,
'no_spaces_around_offset' => true,
'types_spaces' => true,
])
->setRiskyAllowed(true)
->setCacheFile(__DIR__ . '/.php_cs.cache');