-
Notifications
You must be signed in to change notification settings - Fork 7
/
ecs.php
32 lines (26 loc) · 1.16 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
<?php declare(strict_types=1);
use Lmc\CodingStandard\Sniffs\Naming\ClassNameSuffixByParentSniff;
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTestAnnotationFixer;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\CodingStandard\Fixer\LineLength\LineLengthFixer;
use Symplify\EasyCodingStandard\ValueObject\Option;
return static function (ContainerConfigurator $containerConfigurator): void {
$parameters = $containerConfigurator->parameters();
$parameters->set(
Option::SKIP,
[
ClassNameSuffixByParentSniff::class => ['src/Model/Command/*.php'],
]
);
$containerConfigurator->import(__DIR__ . '/vendor/lmc/coding-standard/ecs.php');
$services = $containerConfigurator->services();
// All tests must have @test annotation instead of "test" prefix.
$services->set(PhpUnitTestAnnotationFixer::class)
->call('configure', [['style' => 'annotation']]);
// Force line length
$services->set(LineLengthFixer::class)
->call(
'configure',
[['line_length' => 120, 'break_long_lines' => true, 'inline_short_lines' => false]]
);
};