-
Notifications
You must be signed in to change notification settings - Fork 3
/
.php-cs-fixer.php
89 lines (87 loc) · 3.7 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
80
81
82
83
84
85
86
87
88
89
<?php
$finder = PhpCsFixer\Finder::create()
->in(__DIR__.'/src')
->in(__DIR__.'/tests')
;
return (new PhpCsFixer\Config())
->setCacheFile(__DIR__.'/.cache/php-cs-fixer/.php-cs-fixer.cache')
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
'@Symfony' => true,
'array_syntax' => ['syntax' => 'short'],
'blank_line_after_opening_tag' => true,
'concat_space' => ['spacing' => 'one'],
'declare_strict_types' => false,
'fully_qualified_strict_types' => true,
'header_comment' => false,
'lowercase_cast' => true,
'is_null' => true,
'magic_method_casing' => true,
'modernize_types_casting' => true,
'multiline_comment_opening_closing' => true,
'native_constant_invocation' => ['include' => ['ReturnTypeWillChange', 'UUID_TYPE_RANDOM']],
'no_alias_functions' => true,
'no_alternative_syntax' => true,
'no_blank_lines_after_phpdoc' => true,
'no_empty_comment' => true,
'no_empty_phpdoc' => true,
'no_extra_blank_lines' => ['tokens' => [
'extra',
'use', 'attribute',
'curly_brace_block',
'parenthesis_brace_block',
'square_brace_block',
'switch', 'case', 'default', 'break', 'continue',
'return', 'throw',
]],
'no_leading_import_slash' => true,
'no_spaces_around_offset' => true,
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true],
'no_trailing_comma_in_singleline' => true,
'no_unset_cast' => true,
'no_unused_imports' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'no_whitespace_in_blank_line' => true,
'ordered_imports' => true,
'ordered_interfaces' => true,
'php_unit_mock' => ['target' => 'newest'],
'php_unit_dedicate_assert_internal_type' => ['target' => 'newest'],
'php_unit_expectation' => ['target' => 'newest'],
'php_unit_no_expectation_annotation' => ['target' => 'newest'],
// 'php_unit_test_annotation' => ['style' => 'prefix'],
'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
'php_unit_mock_short_will_return' => true,
'phpdoc_align' => ['align' => 'vertical'],
'phpdoc_line_span' => ['method' => 'multi', 'property' => 'multi'],
'phpdoc_scalar' => true,
'phpdoc_separation' => true,
'phpdoc_single_line_var_spacing' => true,
'phpdoc_trim' => true,
'phpdoc_trim_consecutive_blank_line_separation' => true,
'phpdoc_types' => true,
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
'phpdoc_var_without_name' => true,
'short_scalar_cast' => true,
'single_line_throw' => true,
'single_trait_insert_per_statement' => true,
'standardize_not_equals' => true,
'nullable_type_declaration_for_default_null_value' => true,
'visibility_required' => true,
'yoda_style' => true,
'native_function_invocation' => ['include' => ['@compiler_optimized']],
'compact_nullable_typehint' => true,
'declare_equal_normalize' => ['space' => 'none'],
'function_typehint_space' => true,
'no_leading_namespace_whitespace' => true,
'blank_line_before_statement' => true,
'single_quote' => true,
'phpdoc_to_comment' => false,
'ordered_class_elements' => ['sort_algorithm' => 'none'],
'class_attributes_separation' => ['elements' => ['property' => 'one', 'method' => 'one']],
'array_indentation' => true,
'ternary_to_null_coalescing' => true,
])
->setFinder($finder)
;