Skip to content

Commit 38c9bd4

Browse files
authored
Update ecs.php to new ECSConfig::configure() format (#395)
1 parent 3b4122f commit 38c9bd4

1 file changed

Lines changed: 10 additions & 17 deletions

File tree

‎ecs.php‎

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,21 @@
77
use PhpCsFixer\Fixer\Phpdoc\NoSuperfluousPhpdocTagsFixer;
88
use Symplify\CodingStandard\Fixer\LineLength\DocBlockLineLengthFixer;
99
use Symplify\EasyCodingStandard\Config\ECSConfig;
10-
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
1110

12-
return static function (ECSConfig $ecsConfig): void {
13-
$ecsConfig->sets([SetList::PSR_12, SetList::SYMPLIFY, SetList::COMMON, SetList::CLEAN_CODE]);
14-
15-
$ecsConfig->paths([
11+
return ECSConfig::configure()
12+
->withPaths([
1613
__DIR__ . '/src',
1714
__DIR__ . '/rules',
1815
__DIR__ . '/tests',
1916
__DIR__ . '/rules-tests',
2017
__DIR__ . '/ecs.php',
2118
__DIR__ . '/rector.php',
22-
]);
23-
24-
$ecsConfig->ruleWithConfiguration(NoSuperfluousPhpdocTagsFixer::class, [
19+
])
20+
->withPreparedSets(psr12: true, common: true, cleanCode: true)
21+
->withConfiguredRule(NoSuperfluousPhpdocTagsFixer::class, [
2522
'allow_mixed' => true,
26-
]);
27-
28-
$ecsConfig->ruleWithConfiguration(GeneralPhpdocAnnotationRemoveFixer::class, [
23+
])
24+
->withConfiguredRule(GeneralPhpdocAnnotationRemoveFixer::class, [
2925
'annotations' => [
3026
'throw',
3127
'throws',
@@ -37,16 +33,13 @@
3733
'phpstan-ignore-line',
3834
'phpstan-ignore-next-line',
3935
],
40-
]);
41-
42-
$ecsConfig->rule(StaticLambdaFixer::class);
43-
44-
$ecsConfig->skip([
36+
])
37+
->withRules([StaticLambdaFixer::class])
38+
->withSkip([
4539
'*/Source/*',
4640
'*/Fixture/*',
4741
'*/Expected/*',
4842

4943
// buggy - @todo fix on Symplify master
5044
DocBlockLineLengthFixer::class,
5145
]);
52-
};

0 commit comments

Comments
 (0)