generated from atfromhome/laravel-package-skeleton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecs.php
42 lines (37 loc) · 1.3 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
<?php
declare(strict_types=1);
use PhpCsFixer\Fixer\Import\OrderedImportsFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;
use PhpCsFixer\Fixer\ClassNotation\FinalClassFixer;
use PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer;
use PhpCsFixer\Fixer\FunctionNotation\VoidReturnFixer;
use PhpCsFixer\Fixer\PhpUnit\PhpUnitMethodCasingFixer;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
return static function (ECSConfig $config): void {
$config->paths([
__DIR__ . '/src',
__DIR__ . '/database',
__DIR__ . '/tests',
__DIR__ . '/ecs.php',
]);
$config->import(SetList::ARRAY);
$config->import(SetList::STRICT);
$config->import(SetList::SPACES);
$config->import(SetList::NAMESPACES);
$config->import(SetList::CONTROL_STRUCTURES);
$config->import(SetList::DOCBLOCK);
$config->import(SetList::PSR_12);
$config->import(SetList::CLEAN_CODE);
$config->services()
->set(FinalClassFixer::class)
->set(VoidReturnFixer::class)
->set(DeclareStrictTypesFixer::class)
->set(OrderedImportsFixer::class)
->call('configure', [[
'sort_algorithm' => 'length',
]])
->set(PhpUnitMethodCasingFixer::class)
->call('configure', [[
'case' => 'snake_case',
]]);
};