-
Notifications
You must be signed in to change notification settings - Fork 324
/
ecs.php
29 lines (22 loc) · 970 Bytes
/
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
<?php
use Rector\Set\ValueObject\LevelSetList;
use PhpCsFixer\Fixer\Operator\ConcatSpaceFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Option;
use PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ECSConfig $configurator): void {
// alternative to CLI arguments, easier to maintain and extend
$configurator->paths([__DIR__ . '/lib', __DIR__ . '/tests']);
// choose
$configurator->sets([
SetList::CLEAN_CODE, SetList::PSR_12//, LevelSetList::UP_TO_PHP_81 //, SymfonySetList::SYMFONY_60
]);
$configurator->ruleWithConfiguration(ConcatSpaceFixer::class, [
'spacing' => 'one'
]);
// indent and tabs/spaces
// [default: spaces]. BUT: tabs are superiour due to accessibility reasons
$configurator->indentation('tab');
};