-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathecs.php
44 lines (34 loc) · 1.52 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
<?php
use PhpCsFixer\Fixer\CastNotation\CastSpacesFixer;
use PhpCsFixer\Fixer\Import\GlobalNamespaceImportFixer;
use PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocLineSpanFixer;
use PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer;
use PhpCsFixer\Fixer\StringNotation\NoTrailingWhitespaceInStringFixer;
use PhpCsFixer\Fixer\Whitespace\HeredocIndentationFixer;
use Symplify\CodingStandard\Fixer\LineLength\LineLengthFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
return function (ECSConfig $config): void {
$config->parallel();
$config->paths([__DIR__ . '/src', __DIR__ . '/tests', __FILE__]);
$config->sets([SetList::CLEAN_CODE, SetList::COMMON, SetList::PSR_12]);
$config->rules([LineLengthFixer::class, NoTrailingWhitespaceInStringFixer::class]);
$config->ruleWithConfiguration(CastSpacesFixer::class, [
'space' => 'none',
]);
$config->ruleWithConfiguration(GlobalNamespaceImportFixer::class, [
'import_classes' => true,
'import_constants' => true,
'import_functions' => true,
]);
$config->ruleWithConfiguration(HeredocIndentationFixer::class, [
'indentation' => 'same_as_start',
]);
$config->ruleWithConfiguration(PhpdocLineSpanFixer::class, [
'const' => 'single',
'property' => 'single',
'method' => 'multi',
]);
$config->skip([DeclareStrictTypesFixer::class, NotOperatorWithSuccessorSpaceFixer::class]);
};