-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathecs.php
More file actions
70 lines (59 loc) · 2.02 KB
/
ecs.php
File metadata and controls
70 lines (59 loc) · 2.02 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
<?php
/**
* Phlib ECS config v2025-02
*/
declare(strict_types=1);
use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
return ECSConfig::configure()
->withPaths([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->withRootFiles()
->withSets([
SetList::COMMON,
SetList::PSR_12,
SetList::STRICT,
])
->withSkip([
// Remove sniff, from common/control-structures
\PhpCsFixer\Fixer\ClassNotation\OrderedClassElementsFixer::class,
// Remove sniff, from common/spaces
\PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer::class,
])
// Rule from common/spaces. No space after cast.
->withConfiguredRule(
\PhpCsFixer\Fixer\CastNotation\CastSpacesFixer::class,
[
'space' => 'none',
],
)
/*
* Rule missing from PSR12. PER Coding Style 3:
* "... each of the blocks [of import statements] MUST be separated by a single blank line ..."
*/
->withRules([
\PhpCsFixer\Fixer\Whitespace\BlankLineBetweenImportGroupsFixer::class,
])
// Rule from PSR12. PER Coding Style 7.1: "The `fn` keyword MUST NOT be succeeded by a space."
->withConfiguredRule(
\PhpCsFixer\Fixer\FunctionNotation\FunctionDeclarationFixer::class,
[
'closure_fn_spacing' => 'none',
],
)
/*
* Rule from PER Coding Style 2.6:
* "If the list is split across multiple lines, then the last item MUST have a trailing comma."
*/
->withConfiguredRule(
\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::class,
[
'elements' => [
\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::ELEMENTS_ARGUMENTS,
\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::ELEMENTS_ARRAYS,
\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::ELEMENTS_PARAMETERS,
],
],
);