-
Notifications
You must be signed in to change notification settings - Fork 7
/
.php-cs-fixer.dist.php
74 lines (66 loc) · 2.09 KB
/
.php-cs-fixer.dist.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
<?php
declare(strict_types=1);
require_once __DIR__ . '/vendor/autoload.php';
$finder = (new \Symfony\Component\Finder\Finder())
->in(__DIR__)
->ignoreDotFiles(false)
->ignoreVCS(true)
->exclude([
'.ddev',
'public',
'var',
'vendor',
])
->name('/\.php$/')
;
// foreach ($finder->sortByName() as $file) {
// /** @var SplFileInfo $file */
// dump($file->getRealPath());
// }
$revertedSymfonyRules = [
'cast_spaces' => [ // revert @Symfony
'space' => 'none',
],
'concat_space' => [ // revert @Symfony
'spacing' => 'one',
],
'increment_style' => false, // revert @Symfony
'no_alias_language_construct_call' => false, // revert @Symfony
'nullable_type_declaration_for_default_null_value' => [ // revert @Symfony
'use_nullable_type_declaration' => true,
],
'phpdoc_align' => false, // revert @Symfony
'phpdoc_no_access' => false, // revert @Symfony
'phpdoc_no_package' => false, // revert @Symfony
'phpdoc_to_comment' => false, // revert @Symfony
'single_line_comment_style' => true, // revert @Symfony
'single_line_throw' => false, // revert @Symfony
'yoda_style' => false, // revert @Symfony
];
$revertedPhpCsFixerRules = [
'no_useless_else' => false,
'no_superfluous_elseif' => false,
];
$revertedPHP81Rules = [
'octal_notation' => false,
];
return (new PhpCsFixer\Config())
->setRiskyAllowed(false)
->setRules(array_merge_recursive([
'@DoctrineAnnotation' => true,
'@PHP70Migration' => true,
'@PHP71Migration' => true,
'@PHP73Migration' => true,
'@PHP74Migration' => true,
'@Symfony' => true,
'multiline_whitespace_before_semicolons' => [ // @PhpCsFixer
'strategy' => 'new_line_for_chained_calls',
],
'phpdoc_no_empty_return' => true, // @PhpCsFixer
'operator_linebreak' => [ // adjust @Symfony
'only_booleans' => true,
'position' => 'end',
],
], $revertedPHP81Rules, $revertedPhpCsFixerRules, $revertedSymfonyRules))
->setFinder($finder)
;