-
Notifications
You must be signed in to change notification settings - Fork 1
/
.php-cs-fixer.dist.php
63 lines (58 loc) · 2.21 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
<?php
use PhpCsFixer\Config;
use PhpCsFixerCustomFixers\Fixer\CommentSurroundedBySpacesFixer;
use PhpCsFixerCustomFixers\Fixer\ConstructorEmptyBracesFixer;
use PhpCsFixerCustomFixers\Fixer\DeclareAfterOpeningTagFixer;
use PhpCsFixerCustomFixers\Fixer\MultilineCommentOpeningClosingAloneFixer;
use PhpCsFixerCustomFixers\Fixer\MultilinePromotedPropertiesFixer;
use PhpCsFixerCustomFixers\Fixer\PhpdocArrayStyleFixer;
use PhpCsFixerCustomFixers\Fixer\PhpdocNoSuperfluousParamFixer;
use PhpCsFixerCustomFixers\Fixer\PhpdocParamOrderFixer;
use PhpCsFixerCustomFixers\Fixer\PhpdocTypesTrimFixer;
use PhpCsFixerCustomFixers\Fixer\PromotedConstructorPropertyFixer;
use PhpCsFixerCustomFixers\Fixer\ReadonlyPromotedPropertiesFixer;
$excludes = [
'vendor',
];
$finder = PhpCsFixer\Finder::create()
->in([
__DIR__.'/src',
__DIR__.'/tests',
])
->exclude($excludes);
$rules = [
'@Symfony' => true,
'phpdoc_to_comment' => false,
'trailing_comma_in_multiline' => ['elements' => ['arrays', 'parameters']],
CommentSurroundedBySpacesFixer::name() => true,
ConstructorEmptyBracesFixer::name() => true,
DeclareAfterOpeningTagFixer::name() => true,
MultilineCommentOpeningClosingAloneFixer::name() => true,
MultilinePromotedPropertiesFixer::name() => true,
MultilinePromotedPropertiesFixer::name() => true,
PhpdocArrayStyleFixer::name() => true,
PhpdocNoSuperfluousParamFixer::name() => true,
PhpdocParamOrderFixer::name() => true,
PhpdocTypesTrimFixer::name() => true,
PromotedConstructorPropertyFixer::name() => true,
// '@PSR2' => true,
// 'array_syntax' => ['syntax' => 'short'],
// 'no_useless_else' => true,
// 'yoda_style' => false,
// 'function_declaration' => [
// 'closure_function_spacing' => 'none' //No space before function
// ],
// 'braces' => false, //Disable due to it add space before parenthesis of if or foreach
// 'concat_space' => [
// 'spacing' => 'one'
// ],
// 'phpdoc_align' => [
// 'align' => 'left'
// ],
// 'single_blank_line_at_eof' => false,
];
$config = new PhpCsFixer\Config();
return $config
->registerCustomFixers(new PhpCsFixerCustomFixers\Fixers())
->setRules($rules)
->setFinder($finder);