Completed
Push — master ( 2a87d3...f92572 )
by Tarmo
18s queued 13s
created

anonymous()

Size

Total Lines 144
Code Lines 82

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 82
nc 1
nop 1
dl 0
loc 144
c 0
b 0
f 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
declare(strict_types = 1);
3
/**
4
 * /ecs.php
5
 *
6
 * Configuration for `EasyCodingStandard` tool.
7
 *
8
 * @author TLe, Tarmo Leppänen <[email protected]>
9
 */
10
11
use PhpCsFixer\Fixer\ArrayNotation\NoMultilineWhitespaceAroundDoubleArrowFixer;
0 ignored issues
show
Bug introduced by
The type PhpCsFixer\Fixer\ArrayNo...eAroundDoubleArrowFixer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
use PhpCsFixer\Fixer\CastNotation\CastSpacesFixer;
0 ignored issues
show
Bug introduced by
The type PhpCsFixer\Fixer\CastNotation\CastSpacesFixer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
13
use PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer;
0 ignored issues
show
Bug introduced by
The type PhpCsFixer\Fixer\ClassNo...tributesSeparationFixer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
14
use PhpCsFixer\Fixer\ConstantNotation\NativeConstantInvocationFixer;
0 ignored issues
show
Bug introduced by
The type PhpCsFixer\Fixer\Constan...ConstantInvocationFixer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
15
use PhpCsFixer\Fixer\ControlStructure\YodaStyleFixer;
0 ignored issues
show
Bug introduced by
The type PhpCsFixer\Fixer\ControlStructure\YodaStyleFixer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
16
use PhpCsFixer\Fixer\FunctionNotation\NativeFunctionInvocationFixer;
0 ignored issues
show
Bug introduced by
The type PhpCsFixer\Fixer\Functio...FunctionInvocationFixer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
17
use PhpCsFixer\Fixer\FunctionNotation\SingleLineThrowFixer;
0 ignored issues
show
Bug introduced by
The type PhpCsFixer\Fixer\Functio...on\SingleLineThrowFixer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
18
use PhpCsFixer\Fixer\Import\OrderedImportsFixer;
0 ignored issues
show
Bug introduced by
The type PhpCsFixer\Fixer\Import\OrderedImportsFixer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
19
use PhpCsFixer\Fixer\LanguageConstruct\DeclareEqualNormalizeFixer;
0 ignored issues
show
Bug introduced by
The type PhpCsFixer\Fixer\Languag...lareEqualNormalizeFixer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
20
use PhpCsFixer\Fixer\NamespaceNotation\NoBlankLinesBeforeNamespaceFixer;
0 ignored issues
show
Bug introduced by
The type PhpCsFixer\Fixer\Namespa...nesBeforeNamespaceFixer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
21
use PhpCsFixer\Fixer\Operator\BinaryOperatorSpacesFixer;
0 ignored issues
show
Bug introduced by
The type PhpCsFixer\Fixer\Operato...naryOperatorSpacesFixer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
22
use PhpCsFixer\Fixer\Operator\ConcatSpaceFixer;
0 ignored issues
show
Bug introduced by
The type PhpCsFixer\Fixer\Operator\ConcatSpaceFixer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
23
use PhpCsFixer\Fixer\Operator\IncrementStyleFixer;
0 ignored issues
show
Bug introduced by
The type PhpCsFixer\Fixer\Operator\IncrementStyleFixer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
24
use PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer;
0 ignored issues
show
Bug introduced by
The type PhpCsFixer\Fixer\Operato...WithSuccessorSpaceFixer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
25
use PhpCsFixer\Fixer\Phpdoc\NoSuperfluousPhpdocTagsFixer;
0 ignored issues
show
Bug introduced by
The type PhpCsFixer\Fixer\Phpdoc\...erfluousPhpdocTagsFixer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
26
use PhpCsFixer\Fixer\Phpdoc\PhpdocAlignFixer;
0 ignored issues
show
Bug introduced by
The type PhpCsFixer\Fixer\Phpdoc\PhpdocAlignFixer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
27
use PhpCsFixer\Fixer\Phpdoc\PhpdocNoPackageFixer;
0 ignored issues
show
Bug introduced by
The type PhpCsFixer\Fixer\Phpdoc\PhpdocNoPackageFixer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
28
use PhpCsFixer\Fixer\Phpdoc\PhpdocSeparationFixer;
0 ignored issues
show
Bug introduced by
The type PhpCsFixer\Fixer\Phpdoc\PhpdocSeparationFixer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
29
use PhpCsFixer\Fixer\Phpdoc\PhpdocSummaryFixer;
0 ignored issues
show
Bug introduced by
The type PhpCsFixer\Fixer\Phpdoc\PhpdocSummaryFixer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
30
use PhpCsFixer\Fixer\Phpdoc\PhpdocToCommentFixer;
0 ignored issues
show
Bug introduced by
The type PhpCsFixer\Fixer\Phpdoc\PhpdocToCommentFixer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
31
use PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer;
0 ignored issues
show
Bug introduced by
The type PhpCsFixer\Fixer\PhpTag\...ineAfterOpeningTagFixer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
32
use PhpCsFixer\Fixer\Whitespace\HeredocIndentationFixer;
0 ignored issues
show
Bug introduced by
The type PhpCsFixer\Fixer\Whitesp...HeredocIndentationFixer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
33
use PhpCsFixer\Fixer\Whitespace\BlankLineBeforeStatementFixer;
0 ignored issues
show
Bug introduced by
The type PhpCsFixer\Fixer\Whitesp...ineBeforeStatementFixer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
34
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
35
use Symplify\CodingStandard\Fixer\ArrayNotation\ArrayListItemNewlineFixer;
0 ignored issues
show
Bug introduced by
The type Symplify\CodingStandard\...rayListItemNewlineFixer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
36
use Symplify\CodingStandard\Fixer\ArrayNotation\ArrayOpenerAndCloserNewlineFixer;
0 ignored issues
show
Bug introduced by
The type Symplify\CodingStandard\...erAndCloserNewlineFixer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
37
use Symplify\CodingStandard\Fixer\Commenting\ParamReturnAndVarTagMalformsFixer;
0 ignored issues
show
Bug introduced by
The type Symplify\CodingStandard\...nAndVarTagMalformsFixer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
38
use Symplify\CodingStandard\Fixer\Strict\BlankLineAfterStrictTypesFixer;
0 ignored issues
show
Bug introduced by
The type Symplify\CodingStandard\...neAfterStrictTypesFixer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
39
40
return static function (ContainerConfigurator $containerConfigurator): void {
41
    $imports = [
42
        '/tools/04_symplify/vendor/symplify/easy-coding-standard/config/set/psr12.php',
43
        '/tools/04_symplify/vendor/symplify/easy-coding-standard/config/set/clean-code.php',
44
        '/tools/04_symplify/vendor/symplify/easy-coding-standard/config/set/common.php',
45
        '/tools/04_symplify/vendor/symplify/easy-coding-standard/config/set/symfony.php',
46
        '/tools/04_symplify/vendor/symplify/easy-coding-standard/config/set/symfony-risky.php',
47
    ];
48
49
    array_map(
50
        [$containerConfigurator, 'import'],
51
        array_map(static fn (string $path): string => __DIR__ . $path, $imports)
52
    );
53
54
    $services = $containerConfigurator->services();
55
56
    $services
57
        ->set(IncrementStyleFixer::class)
58
        ->call(
59
            'configure',
60
            [
61
                [
62
                    'style' => 'post',
63
                ],
64
            ],
65
        );
66
67
    $services
68
        ->set(YodaStyleFixer::class)
69
        ->call(
70
            'configure',
71
            [
72
                [
73
                    'equal' => false,
74
                    'identical' => false,
75
                    'less_and_greater' => false,
76
                ],
77
            ],
78
        );
79
80
    $services
81
        ->set(ConcatSpaceFixer::class)
82
        ->call(
83
            'configure',
84
            [
85
                [
86
                    'spacing' => 'one',
87
                ],
88
            ],
89
        );
90
91
    $services
92
        ->set(CastSpacesFixer::class)
93
        ->call(
94
            'configure',
95
            [
96
                [
97
                    'space' => 'none',
98
                ],
99
            ],
100
        );
101
102
    $services
103
        ->set(OrderedImportsFixer::class)
104
        ->call(
105
            'configure',
106
            [
107
                [
108
                    'imports_order' => ['class', 'function', 'const'],
109
                ],
110
            ],
111
        );
112
113
    $services
114
        ->set(NoSuperfluousPhpdocTagsFixer::class)
115
        ->call(
116
            'configure',
117
            [
118
                [
119
                    'remove_inheritdoc' => false,
120
                    'allow_mixed' => true,
121
                    'allow_unused_params' => false,
122
                ],
123
            ],
124
        );
125
126
    $services
127
        ->set(DeclareEqualNormalizeFixer::class)
128
        ->call(
129
            'configure',
130
            [
131
                [
132
                    'space' => 'single',
133
                ],
134
            ],
135
        );
136
137
    $services
138
        ->set(BlankLineBeforeStatementFixer::class)
139
        ->call(
140
            'configure',
141
            [
142
                [
143
                    'statements' => ['continue', 'declare', 'return', 'throw', 'try'],
144
                ],
145
            ],
146
        );
147
148
    $services
149
        ->set(BinaryOperatorSpacesFixer::class)
150
        ->call(
151
            'configure',
152
            [
153
                [
154
                    'operators' => [
155
                        '&' => 'align'
156
                    ]
157
                ],
158
            ],
159
        );
160
161
    $parameters = $containerConfigurator->parameters();
162
163
    $parameters->set(
164
        'skip',
165
        [
166
            NoMultilineWhitespaceAroundDoubleArrowFixer::class => null,
167
            PhpdocNoPackageFixer::class => null,
168
            PhpdocSummaryFixer::class => null,
169
            PhpdocSeparationFixer::class => null,
170
            BlankLineAfterOpeningTagFixer::class => null,
171
            ClassAttributesSeparationFixer::class => null,
172
            NoBlankLinesBeforeNamespaceFixer::class => null,
173
            NotOperatorWithSuccessorSpaceFixer::class => null,
174
            SingleLineThrowFixer::class => null,
175
            BlankLineAfterStrictTypesFixer::class => null,
176
            ParamReturnAndVarTagMalformsFixer::class => null,
177
            ArrayOpenerAndCloserNewlineFixer::class => null,
178
            ArrayListItemNewlineFixer::class => null,
179
            PhpdocAlignFixer::class => null,
180
            HeredocIndentationFixer::class => null,
181
            PhpdocToCommentFixer::class => null,
182
            NativeFunctionInvocationFixer::class => null,
183
            NativeConstantInvocationFixer::class => null,
184
        ]
185
    );
186
};
187