forked from deprecated-packages/symplify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathecs.php
61 lines (52 loc) · 2.09 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
declare(strict_types=1);
use SlevomatCodingStandard\Sniffs\TypeHints\ParameterTypeHintSniff;
use SlevomatCodingStandard\Sniffs\TypeHints\ReturnTypeHintSniff;
use Symplify\CodingStandard\Fixer\Annotation\DoctrineAnnotationNestedBracketsFixer;
use Symplify\CodingStandard\Fixer\LineLength\LineLengthFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
return static function (ECSConfig $ecsConfig): void {
$ecsConfig->rule(LineLengthFixer::class);
$ecsConfig->rule(ParameterTypeHintSniff::class);
$ecsConfig->rule(ReturnTypeHintSniff::class);
$ecsConfig->ruleWithConfiguration(DoctrineAnnotationNestedBracketsFixer::class, [
DoctrineAnnotationNestedBracketsFixer::ANNOTATION_CLASSES => ['Doctrine\ORM\JoinColumns'],
]);
$ecsConfig->sets([
SetList::CLEAN_CODE,
SetList::SYMPLIFY,
SetList::COMMON,
SetList::PSR_12,
SetList::DOCTRINE_ANNOTATIONS,
]);
$ecsConfig->paths([
__DIR__ . '/packages',
__DIR__ . '/tests',
__DIR__ . '/ecs.php',
__DIR__ . '/monorepo-builder.php',
__DIR__ . '/rector.php',
]);
$ecsConfig->skip([
// paths to skip
'*/Fixture/*',
'*/Source/*',
// PHP 8 only
__DIR__ . '/packages/phpstan-rules/tests/Rules/ForbiddenArrayWithStringKeysRule/FixturePhp80/SkipAttributeArrayKey.php',
// slevomat cs
ParameterTypeHintSniff::class => [
// break parent contract
__DIR__ . '/packages/easy-coding-standard/packages/SniffRunner/ValueObject/File.php',
],
ReturnTypeHintSniff::class => [
// break parent contract
__DIR__ . '/packages/easy-coding-standard/packages/SniffRunner/ValueObject/File.php',
// returned null
'*Visitor.php',
],
ParameterTypeHintSniff::class . '.MissingNativeTypeHint' => [
// breaks interface contract
__DIR__ . '/packages/config-transformer/src/DependencyInjection/Loader/IdAwareXmlFileLoader.php',
],
]);
};