-
Notifications
You must be signed in to change notification settings - Fork 19
/
.php_cs.php
97 lines (89 loc) · 3.64 KB
/
.php_cs.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
<?php
$finder = \PhpCsFixer\Finder::create()
->in(__DIR__);
return (new \PhpCsFixer\Config())
->setFinder($finder)
->setRules(
[
// generic PSRs
'@PSR1' => true,
'@PSR2' => true,
'@PSR12' => true,
'@PSR12:risky' => true,
'psr_autoloading' => true,
// imports
'ordered_imports' => true,
'no_extra_blank_lines' => ['use'],
// PhpCsFixer, but exclude Oro cases
'@PhpCsFixer' => true,
'@PhpCsFixer:risky' => true,
'multiline_whitespace_before_semicolons' => false,
'method_chaining_indentation' => false,
'php_unit_internal_class' => false,
'php_unit_test_class_requires_covers' => false,
'final_internal_class' => false,
'php_unit_strict' => false,
'php_unit_test_case_static_method_calls' => ['call_type' => 'this'],
'ordered_class_elements' => false,
'array_indentation' => false,
'phpdoc_order' => false,
'strict_comparison' => false,
'explicit_string_variable' => false,
'php_unit_set_up_tear_down_visibility' => false,
'strict_param' => false,
'heredoc_to_nowdoc' => false,
'return_assignment' => false,
'escape_implicit_backslashes' => false,
// PHP
'@PHP74Migration' => true,
'@PHP74Migration:risky' => true,
'@PHP80Migration' => true,
'@PHP80Migration:risky' => true,
'use_arrow_functions' => false,
'get_class_to_class_keyword' => false,
'void_return' => false,
'list_syntax' => ['syntax' => 'long'],
'declare_strict_types' => false,
// Doctrine with Oro compat
'@DoctrineAnnotation' => true,
'doctrine_annotation_array_assignment' => ['operator' => '='],
'doctrine_annotation_braces' => false,
'doctrine_annotation_indentation' => false,
'doctrine_annotation_spaces' => [
'after_array_assignments_colon' => false,
'after_array_assignments_equals' => false,
'before_array_assignments_colon' => false,
'before_array_assignments_equals' => false,
],
// Symfony, but exclude Oro cases
'@Symfony' => true,
'@Symfony:risky' => true,
'phpdoc_types_order' => false,
'phpdoc_separation' => false,
'visibility_required' => ['elements' => ['property', 'method']],
'types_spaces' => false,
'native_function_invocation' => false,
'concat_space' => ['spacing' => 'one'],
'single_space_around_construct' => false,
'self_accessor' => false,
'yoda_style' => false,
'phpdoc_summary' => false,
'binary_operator_spaces' => false,
'phpdoc_align' => false,
'cast_spaces' => false,
'phpdoc_annotation_without_dot' => false,
'standardize_increment' => false,
'phpdoc_scalar' => false,
'phpdoc_var_without_name' => false,
'increment_style' => false,
'non_printable_character' => false,
'phpdoc_no_alias_tag' => false,
'single_quote' => false,
'fopen_flags' => false,
'ternary_operator_spaces' => false,
'phpdoc_no_useless_inheritdoc' => false,
'class_definition' => false,
'string_length_to_empty' => false,
]
)
->setRiskyAllowed(true);