-
Notifications
You must be signed in to change notification settings - Fork 1
/
ecs.php
47 lines (44 loc) · 2.01 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
43
44
45
46
47
<?php
declare(strict_types=1);
use Contao\EasyCodingStandard\Fixer\CommentLengthFixer;
use Contao\EasyCodingStandard\Set\SetList;
use PhpCsFixer\Fixer\Basic\BracesPositionFixer;
use PhpCsFixer\Fixer\Comment\HeaderCommentFixer;
use PhpCsFixer\Fixer\ControlStructure\ControlStructureContinuationPositionFixer;
use PhpCsFixer\Fixer\Import\NoUnusedImportsFixer;
use PhpCsFixer\Fixer\Whitespace\MethodChainingIndentationFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Option;
return ECSConfig::configure()
->withSets([SetList::CONTAO])
->withPaths([
__DIR__.'/src',
])
->withRules([
NoUnusedImportsFixer::class,
])
->withConfiguredRule(BracesPositionFixer::class, [
'control_structures_opening_brace' => 'next_line_unless_newline_at_signature_end',
'functions_opening_brace' => 'next_line_unless_newline_at_signature_end',
'anonymous_functions_opening_brace' => 'next_line_unless_newline_at_signature_end',
'classes_opening_brace' => 'next_line_unless_newline_at_signature_end',
'anonymous_classes_opening_brace' => 'next_line_unless_newline_at_signature_end',
'allow_single_line_empty_anonymous_classes' => false,
'allow_single_line_anonymous_functions' => false,
])
->withConfiguredRule(ControlStructureContinuationPositionFixer::class, [
'position' => 'next_line',
])
->withConfiguredRule(HeaderCommentFixer::class, [
'header' => "This file is part of Contao Theme Compiler Bundle.\n\n@package contao-theme-compiler-bundle\n@license MIT\n@author Daniele Sciannimanica <https://github.com/doishub>\n@copyright Oveleon <https://www.oveleon.de/>",
'comment_type' => 'comment',
'location' => 'after_declare_strict',
])
->withSkip([
'*/languages/*',
CommentLengthFixer::class,
MethodChainingIndentationFixer::class,
])
->withParallel()
->withSpacing(Option::INDENTATION_SPACES, "\n")
;