-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathecs.php
46 lines (40 loc) · 1.56 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
<?php
declare(strict_types=1);
use PhpCsFixer\Fixer\FunctionNotation\PhpdocToPropertyTypeFixer;
use PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer;
use Shopsys\CodingStandards\CsFixer\ForbiddenPrivateVisibilityFixer;
use Shopsys\CodingStandards\Sniffs\ForceLateStaticBindingForProtectedConstantsSniff;
use Shopsys\CodingStandards\Sniffs\ObjectIsCreatedByFactorySniff;
use Symplify\EasyCodingStandard\Config\ECSConfig;
/**
* @param Symplify\EasyCodingStandard\Config\ECSConfig $ecsConfig
*/
return static function (ECSConfig $ecsConfig): void {
$ecsConfig->rule(ForceLateStaticBindingForProtectedConstantsSniff::class);
/*
* this package is meant to be extensible using class inheritance,
* so we want to avoid private visibilities in the model namespace
*/
$services = $ecsConfig->services();
$services->set('forbidden_private_visibility_fixer.read_model', ForbiddenPrivateVisibilityFixer::class)
->call('configure', [
[
'analyzed_namespaces' => [
'Shopsys\ReadModelBundle',
],
],
]);
$ecsConfig->skip([
ObjectIsCreatedByFactorySniff::class => [
__DIR__ . '/src/Product/Detail/ProductDetailViewElasticsearchFactory.php',
__DIR__ . '/tests/*',
],
PhpdocToPropertyTypeFixer::class => [
__DIR__ . '/src/*',
],
DeclareStrictTypesFixer::class => [
__DIR__ . '/src/*',
],
]);
$ecsConfig->import(__DIR__ . '/vendor/shopsys/coding-standards/ecs.php', null, true);
};