-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathecs.php
More file actions
111 lines (109 loc) · 3.43 KB
/
Copy pathecs.php
File metadata and controls
111 lines (109 loc) · 3.43 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
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?php
declare(strict_types = 1);
/**
* /ecs.php
*
* Configuration for `EasyCodingStandard` tool.
*
* @author TLe, Tarmo Leppänen <tarmo.leppanen@pinja.com>
*/
use PhpCsFixer\Fixer\ArrayNotation\NoMultilineWhitespaceAroundDoubleArrowFixer;
use PhpCsFixer\Fixer\CastNotation\CastSpacesFixer;
use PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer;
use PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer;
use PhpCsFixer\Fixer\ControlStructure\YodaStyleFixer;
use PhpCsFixer\Fixer\Import\OrderedImportsFixer;
use PhpCsFixer\Fixer\LanguageConstruct\DeclareEqualNormalizeFixer;
use PhpCsFixer\Fixer\Operator\BinaryOperatorSpacesFixer;
use PhpCsFixer\Fixer\Operator\ConcatSpaceFixer;
use PhpCsFixer\Fixer\Operator\IncrementStyleFixer;
use PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer;
use PhpCsFixer\Fixer\Phpdoc\NoSuperfluousPhpdocTagsFixer;
use PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer;
use PhpCsFixer\Fixer\Whitespace\BlankLineBeforeStatementFixer;
use PhpCsFixer\Fixer\Whitespace\MethodChainingIndentationFixer;
use Symplify\CodingStandard\Fixer\Annotation\RemovePropertyVariableNameDescriptionFixer;
use Symplify\CodingStandard\Fixer\Spacing\MethodChainingNewlineFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;
return ECSConfig::configure()
->withPaths([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->withPreparedSets(psr12: true, common: true, cleanCode: true)
->withConfiguredRule(
IncrementStyleFixer::class,
[
'style' => 'post',
],
)
->withConfiguredRule(
CastSpacesFixer::class,
[
'space' => 'none',
],
)
->withConfiguredRule(
YodaStyleFixer::class,
[
'equal' => false,
'identical' => false,
'less_and_greater' => false,
],
)
->withConfiguredRule(
ConcatSpaceFixer::class,
[
'spacing' => 'one',
],
)
->withConfiguredRule(
OrderedImportsFixer::class,
[
'imports_order' => ['class', 'function', 'const'],
],
)
->withConfiguredRule(
NoSuperfluousPhpdocTagsFixer::class,
[
'remove_inheritdoc' => false,
'allow_mixed' => true,
'allow_unused_params' => false,
],
)
->withConfiguredRule(
DeclareEqualNormalizeFixer::class,
[
'space' => 'single',
],
)
->withConfiguredRule(
BlankLineBeforeStatementFixer::class,
[
'statements' => ['continue', 'declare', 'return', 'throw', 'try'],
],
)
->withConfiguredRule(
BinaryOperatorSpacesFixer::class,
[
'operators' => [
'&' => 'align',
],
],
)
->withConfiguredRule(
TrailingCommaInMultilineFixer::class,
[
'after_heredoc' => true,
'elements' => ['arguments', 'array_destructuring', 'arrays', 'match', 'parameters'],
],
)
->withSkip([
BlankLineAfterOpeningTagFixer::class => null,
ClassAttributesSeparationFixer::class => null,
MethodChainingIndentationFixer::class => null,
MethodChainingNewlineFixer::class => null,
NoMultilineWhitespaceAroundDoubleArrowFixer::class => null,
NotOperatorWithSuccessorSpaceFixer::class => null,
RemovePropertyVariableNameDescriptionFixer::class => null,
]);