-
Notifications
You must be signed in to change notification settings - Fork 6
/
ecs.php
59 lines (47 loc) · 1.72 KB
/
ecs.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
<?php
declare(strict_types=1);
use PhpCsFixer\Fixer\ControlStructure\YodaStyleFixer;
use PhpCsFixer\Fixer\Import\NoUnusedImportsFixer;
use PhpCsFixer\Fixer\Import\OrderedImportsFixer;
use PhpCsFixer\Fixer\Operator\ConcatSpaceFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocTypesOrderFixer;
use PhpCsFixerCustomFixers\Fixer\NoDuplicatedImportsFixer;
use Symplify\CodingStandard\Fixer\LineLength\DocBlockLineLengthFixer;
use Symplify\CodingStandard\Fixer\LineLength\LineLengthFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
return static function (ECSConfig $ecsConfig): void {
$ecsConfig->parallel();
$ecsConfig->paths([
__DIR__ . '/src',
]);
$ecsConfig->skip([
__DIR__ . '/src/DependencyInjection/Configuration.php',
]);
$ecsConfig->sets([
SetList::SYMPLIFY,
SetList::PSR_12,
SetList::DOCTRINE_ANNOTATIONS,
SetList::CLEAN_CODE,
]);
$ecsConfig->ruleWithConfiguration(YodaStyleFixer::class, [
'equal' => false,
'identical' => false,
'less_and_greater' => false,
]);
$ecsConfig->ruleWithConfiguration(PhpdocTypesOrderFixer::class, [
'null_adjustment' => 'always_last',
'sort_algorithm' => 'none',
]);
$ecsConfig->ruleWithConfiguration(OrderedImportsFixer::class, [
'imports_order' => ['class', 'function', 'const'],
]);
$ecsConfig->ruleWithConfiguration(ConcatSpaceFixer::class, [
'spacing' => 'one',
]);
$ecsConfig->ruleWithConfiguration(LineLengthFixer::class, [
LineLengthFixer::LINE_LENGTH => 120,
]);
$ecsConfig->rule(NoUnusedImportsFixer::class);
$ecsConfig->rule(NoDuplicatedImportsFixer::class);
};