-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathecs.php
52 lines (45 loc) · 1.69 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
<?php
/*
|--------------------------------------------------------------------------
| Easy Coding Standard configuration
|--------------------------------------------------------------------------
*/
use PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer;
use PhpCsFixer\Fixer\CastNotation\CastSpacesFixer;
use PhpCsFixer\Fixer\Import\NoUnusedImportsFixer;
use PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer;
use PhpCsFixer\Fixer\Operator\UnaryOperatorSpacesFixer;
use PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer;
use PhpCsFixer\Fixer\StringNotation\SingleQuoteFixer;
use PhpCsFixer\Fixer\Whitespace\NoExtraBlankLinesFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Option;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
return static function (ECSConfig $ecsConfig): void {
$ecsConfig->paths([
__DIR__ . '/src',
__DIR__ . '/tests',
]);
$ecsConfig->skip([
// skip paths with legacy code
// __DIR__ . '/packages/*/src/Legacy',
// skip rule completely
BlankLineAfterOpeningTagFixer::class,
UnaryOperatorSpacesFixer::class
]);
// A. full sets
$ecsConfig->sets([SetList::PSR_12]);
// B. standalone rule
$ecsConfig->ruleWithConfiguration(ArraySyntaxFixer::class, [
'syntax' => 'short',
]);
$ecsConfig->rules([
CastSpacesFixer::class,
NotOperatorWithSuccessorSpaceFixer::class,
NoUnusedImportsFixer::class,
NoExtraBlankLinesFixer::class,
SingleQuoteFixer::class,
]);
$parameters = $ecsConfig->parameters();
$parameters->set(Option::CACHE_DIRECTORY, __DIR__ . '/storage/ecs_cache');
};