-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathecs.php
79 lines (64 loc) · 2.5 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
/*
* This file is part of the NumberNine package.
*
* (c) William Arin <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
use PhpCsFixer\Fixer\ControlStructure\SwitchCaseSemicolonToColonFixer;
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 PhpCsFixer\Fixer\PhpUnit\PhpUnitStrictFixer;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\CodingStandard\Fixer\LineLength\LineLengthFixer;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
use Symplify\EasyCodingStandard\ValueObject\Option;
return static function (ContainerConfigurator $containerConfigurator): void {
$parameters = $containerConfigurator->parameters();
$parameters->set(Option::PARALLEL, true);
$parameters->set(Option::PATHS, [
__DIR__ . '/src',
__DIR__ . '/tests',
]);
$parameters->set(Option::SKIP, [
__DIR__ . '/src/Bundle/Resources/public',
SwitchCaseSemicolonToColonFixer::class,
PhpUnitStrictFixer::class,
]);
$containerConfigurator->import(SetList::PSR_12);
$containerConfigurator->import(SetList::PHP_CS_FIXER);
$containerConfigurator->import(SetList::PHP_CS_FIXER_RISKY);
$containerConfigurator->import(SetList::DOCTRINE_ANNOTATIONS);
$containerConfigurator->import(SetList::CLEAN_CODE);
$services = $containerConfigurator->services();
$services->set(YodaStyleFixer::class)
->call('configure', [[
'equal' => false,
'identical' => false,
'less_and_greater' => false,
]]);
$services->set(PhpdocTypesOrderFixer::class)
->call('configure', [[
'null_adjustment' => 'always_last',
'sort_algorithm' => 'none',
]]);
$services->set(OrderedImportsFixer::class)
->call('configure', [[
'imports_order' => ['class', 'function', 'const'],
]]);
$services->set(ConcatSpaceFixer::class)
->call('configure', [[
'spacing' => 'one',
]]);
$services->set(LineLengthFixer::class)
->call('configure', [[
LineLengthFixer::LINE_LENGTH => 120,
]]);
$services->set(NoUnusedImportsFixer::class);
};