forked from redaxo/redaxo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.php_cs.dist
91 lines (88 loc) · 2.94 KB
/
.php_cs.dist
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
<?php
$src = __DIR__.'/redaxo/src';
$bootPath = realpath($src.'/core/boot.php');
$tools = __DIR__.'/.tools';
$finder = PhpCsFixer\Finder::create()
->in([
$src.'/core',
$src.'/addons/backup',
$src.'/addons/be_style',
$src.'/addons/cronjob',
$src.'/addons/debug',
$src.'/addons/install',
$src.'/addons/media_manager',
$src.'/addons/mediapool',
$src.'/addons/metainfo',
$src.'/addons/phpmailer',
$src.'/addons/project',
$src.'/addons/structure',
$src.'/addons/users',
$tools,
])
->append([
__FILE__,
$tools.'/bin/clone-addon',
$tools.'/bin/release',
$tools.'/bin/setup',
$tools.'/bin/update-root-composer',
])
->filter(static function (\SplFileInfo $file) use ($bootPath) {
return $bootPath !== $file->getRealPath();
})
;
return PhpCsFixer\Config::create()
->setUsingCache(true)
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
'@PHP71Migration' => true,
'@PHP71Migration:risky' => true,
'@PHPUnit75Migration:risky' => true,
'array_indentation' => true,
'blank_line_before_statement' => false,
'braces' => ['allow_single_line_closure' => false],
'comment_to_phpdoc' => true,
'concat_space' => false,
'declare_strict_types' => false,
'function_to_constant' => ['functions' => ['get_class', 'get_called_class', 'php_sapi_name', 'phpversion', 'pi']],
'heredoc_to_nowdoc' => true,
'list_syntax' => ['syntax' => 'short'],
'logical_operators' => true,
'native_constant_invocation' => false,
'no_blank_lines_after_phpdoc' => false,
'no_null_property_initialization' => true,
'no_php4_constructor' => true,
'no_superfluous_elseif' => true,
'no_unreachable_default_argument_value' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_class_elements' => ['order' => [
'use_trait',
'constant_public',
'constant_protected',
'constant_private',
'property',
'construct',
'phpunit',
'method',
]],
'php_unit_internal_class' => true,
'php_unit_method_casing' => true,
'php_unit_set_up_tear_down_visibility' => true,
'php_unit_test_case_static_method_calls' => true,
'phpdoc_no_package' => false,
'phpdoc_order' => true,
'phpdoc_to_comment' => false,
'phpdoc_types_order' => false,
'phpdoc_var_annotation_correct_order' => true,
'phpdoc_var_without_name' => false,
'psr4' => false,
'semicolon_after_instruction' => false,
'static_lambda' => true,
'string_line_ending' => true,
'void_return' => false,
'yoda_style' => true,
])
->setFinder($finder)
;