-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.php-cs-fixer.php
More file actions
48 lines (43 loc) · 1.24 KB
/
.php-cs-fixer.php
File metadata and controls
48 lines (43 loc) · 1.24 KB
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
<?php
use TYPO3\CodingStandards\CsFixerConfig;
$csFixerConfig = CsFixerConfig::create();
$csFixerConfig
->getFinder()
->in([
__DIR__,
])
->exclude([
'.Build',
'var',
'config',
'.ddev',
'Resources/Private/frontendSrc',
]);
// replace deprecated rules
$replacements = [
'@PER-CS1.0' => '@PER-CS1x0',
];
$rules = $csFixerConfig->getRules();
foreach ($replacements as $deprecatedRule => $replacementRule) {
if (array_key_exists($deprecatedRule, $rules)) {
$deprecatedRuleValue = $rules[$deprecatedRule];
$rules[$replacementRule] = $deprecatedRuleValue;
unset($rules[$deprecatedRule]);
}
}
$csFixerConfig->setRules(array_replace_recursive(
$rules,
[
'fully_qualified_strict_types' => [
'import_symbols' => true,
'leading_backslash_in_global_namespace' => false,
],
'global_namespace_import' => false,
'header_comment' => ['header' => ''],
'single_line_comment_style' => ['comment_types' => ['hash']],
'single_line_empty_body' => false,
'no_trailing_comma_in_singleline' => true,
'php_unit_test_annotation' => ['style' => 'annotation'],
]
));
return $csFixerConfig;