forked from LKaemmerling/prometheus_client_php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
easy-coding-standard.php
53 lines (38 loc) · 2.18 KB
/
easy-coding-standard.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
53
<?php
declare(strict_types=1);
use PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer;
use PhpCsFixer\Fixer\ControlStructure\YodaStyleFixer;
use PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer;
use PhpCsFixer\Fixer\Import\FullyQualifiedStrictTypesFixer;
use PhpCsFixer\Fixer\Operator\BinaryOperatorSpacesFixer;
use PhpCsFixer\Fixer\Operator\ConcatSpaceFixer;
use PhpCsFixer\Fixer\Operator\IncrementStyleFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocAlignFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocAnnotationWithoutDotFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocSeparationFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocSummaryFixer;
use PhpCsFixer\Fixer\PhpUnit\PhpUnitFqcnAnnotationFixer;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\CodingStandard\Fixer\LineLength\LineLengthFixer;
return static function (ContainerConfigurator $containerConfigurator): void {
$containerConfigurator->import(__DIR__ . '/vendor/symplify/easy-coding-standard/config/set/clean-code.php');
$containerConfigurator->import(__DIR__ . '/vendor/symplify/easy-coding-standard/config/set/symfony.php');
$services = $containerConfigurator->services();
$services->set(ArraySyntaxFixer::class)
->call('configure', [['syntax' => 'short']]);
$services->set(ConcatSpaceFixer::class)
->call('configure', [['spacing' => 'one']]);
$services->set(BinaryOperatorSpacesFixer::class)
->call('configure', [['operators' => ['=>' => 'align']]]);
$services->set(MethodArgumentSpaceFixer::class)
->call('configure', [['on_multiline' => 'ensure_fully_multiline']]);
$services->set(LineLengthFixer::class);
$services->set(FullyQualifiedStrictTypesFixer::class);
$parameters = $containerConfigurator->parameters();
$parameters->set('line_ending', "\n");
$parameters->set('exclude_files', ['*/var/cache/*', '*/var/logs/*']);
$parameters->set(
'skip',
[YodaStyleFixer::class => null, IncrementStyleFixer::class => null, PhpdocSeparationFixer::class => null, PhpdocAnnotationWithoutDotFixer::class => null, PhpdocSummaryFixer::class => null, PhpUnitFqcnAnnotationFixer::class => null, PhpdocAlignFixer::class => null]
);
};