-
Notifications
You must be signed in to change notification settings - Fork 1
/
.php-cs-fixer.php
79 lines (76 loc) · 3.07 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
79
<?php
$rules = [
'@PSR12' => true,
'concat_space' => ['spacing' => 'one'],
'no_multiline_whitespace_around_double_arrow' => true,
'no_empty_statement' => true,
'include' => true,
'no_alias_functions' => true,
'no_trailing_comma_in_singleline' => ['elements' => ['arguments', 'array_destructuring', 'array', 'group_import']],
'not_operator_with_successor_space' => true,
'trailing_comma_in_multiline' => ['after_heredoc' => false, 'elements' => ['arrays']],
'multiline_whitespace_before_semicolons' => true,
'no_leading_namespace_whitespace' => true,
'no_blank_lines_after_phpdoc' => true,
'object_operator_without_whitespace' => true,
'phpdoc_indent' => true,
'phpdoc_inline_tag_normalizer' => true,
'phpdoc_tag_type' => true,
'general_phpdoc_tag_rename' => true,
'phpdoc_no_access' => true,
'phpdoc_no_package' => false,
'phpdoc_scalar' => true,
'phpdoc_summary' => true,
'phpdoc_to_comment' => true,
'phpdoc_trim' => true,
'phpdoc_no_alias_tag' => ['replacements' => ['type' => 'var']],
'phpdoc_var_without_name' => true,
'no_extra_blank_lines' => ['tokens' => ['extra', 'use']],
'self_accessor' => false,
'array_syntax' => ['syntax' => 'short'],
'echo_tag_syntax' => ['format' => 'long', 'long_function' => 'echo', 'shorten_simple_statements_only' => true],
'single_quote' => true,
'no_singleline_whitespace_before_semicolons' => true,
'cast_spaces' => ['space' => 'single'],
'standardize_not_equals' => true,
'trim_array_spaces' => true,
'binary_operator_spaces' => ['operators' => ['|' => null, '=>' => 'single_space', '=' => 'single_space'], ],
'unary_operator_spaces' => true,
'no_unused_imports' => true,
'mb_str_functions' => true,
'combine_consecutive_unsets' => true,
'dir_constant' => true,
'type_declaration_spaces' => ['elements' => ['function', 'property']],
'is_null' => true,
'class_attributes_separation' => ['elements' => ['const' => 'one', 'method' => 'one', 'property' => 'one', 'trait_import' => 'none']],
'modernize_types_casting' => true,
'no_php4_constructor' => true,
'no_short_bool_cast' => true,
'no_useless_else' => true,
'normalize_index_brace' => true,
'phpdoc_no_useless_inheritdoc' => true,
'pow_to_exponentiation' => true,
'psr_autoloading' => true,
'align_multiline_comment' => ['comment_type' => 'phpdocs_only'],
'single_line_comment_style' => ['comment_types' => ['hash']],
'no_null_property_initialization' => true,
'non_printable_character' => false,
'blank_line_before_statement' => true,
'no_superfluous_elseif' => true,
'method_chaining_indentation' => true,
'php_unit_construct' => true,
'array_indentation' => true,
'ordered_class_elements' => true,
];
$finder = PhpCsFixer\Finder::create()
->in([
__DIR__ . '/src',
__DIR__ . '/publish',
]);
return (new PhpCsFixer\Config())
->setIndent(' ')
->setLineEnding("\n")
->setRules($rules)
->setFinder($finder)
->setRiskyAllowed(true)
->setUsingCache(true);