-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathecs.php
More file actions
78 lines (75 loc) · 2.06 KB
/
ecs.php
File metadata and controls
78 lines (75 loc) · 2.06 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
<?php
declare(strict_types=1);
use PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer;
use PhpCsFixer\Fixer\ClassNotation\OrderedClassElementsFixer;
use PhpCsFixer\Fixer\ClassNotation\OrderedTraitsFixer;
use PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer;
use PhpCsFixer\Fixer\Import\NoUnusedImportsFixer;
use PhpCsFixer\Fixer\Import\OrderedImportsFixer;
use PhpCsFixer\Fixer\StringNotation\SingleQuoteFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;
return ECSConfig::configure()
->withConfiguredRule(
ClassDefinitionFixer::class,
[
'space_before_parenthesis' => true,
],
)
->withConfiguredRule(
OrderedClassElementsFixer::class,
[
'order' => [
'use_trait',
'constant_public',
'constant_protected',
'constant_private',
'case',
'property_public',
'property_protected',
'property_private',
'construct',
'destruct',
'magic',
'phpunit',
'method_public',
'method_protected',
'method_private',
],
'sort_algorithm' => 'alpha',
],
)
->withConfiguredRule(
OrderedImportsFixer::class,
[
'imports_order' => ['class', 'function', 'const'],
'sort_algorithm' => 'alpha',
],
)
->withConfiguredRule(
VisibilityRequiredFixer::class,
[
'elements' => [],
],
)
->withFileExtensions(['php'])
->withPaths(
[
__DIR__ . '/src',
__DIR__ . '/tests',
],
)
->withPhpCsFixerSets(perCS20: true)
->withPreparedSets(
cleanCode: true,
comments: true,
docblocks: true,
namespaces: true,
strict: true,
)
->withRules(
[
NoUnusedImportsFixer::class,
OrderedTraitsFixer::class,
SingleQuoteFixer::class,
]
);