-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrector.php
62 lines (55 loc) · 3.28 KB
/
rector.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
62
<?php
/**
* Copyright © 2021-present Spryker Systems GmbH. All rights reserved.
* Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
*/
use Rector\CodeQuality\Rector\Array_\CallableThisArrayToAnonymousFunctionRector;
use Rector\Config\RectorConfig;
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
use Rector\Set\ValueObject\SetList;
use Rector\TypeDeclaration\Rector\ClassMethod\AddParamTypeFromPropertyTypeRector;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
__DIR__ . '/src/Spryker',
__DIR__ . '/tests/SprykerTest',
]);
$rectorConfig->skip([
'*/_support/_generated/*',
]);
$rectorConfig->import(SetList::CODE_QUALITY);
$rectorConfig->import(SetList::CODING_STYLE);
$rectorConfig->import(SetList::DEAD_CODE);
$rectorConfig->import(SetList::STRICT_BOOLEANS);
$rectorConfig->import(SetList::NAMING);
$rectorConfig->import(SetList::PHP_82);
$rectorConfig->import(SetList::TYPE_DECLARATION);
$rectorConfig->import(SetList::EARLY_RETURN);
$rectorConfig->import(SetList::INSTANCEOF);
$rectorConfig->ruleWithConfiguration(ClassPropertyAssignToConstructorPromotionRector::class, [
ClassPropertyAssignToConstructorPromotionRector::INLINE_PUBLIC => true,
]);
$rectorConfig->skip([
// Ignore this rule on the AppRouteProviderPlugin as it breaks the code
CallableThisArrayToAnonymousFunctionRector::class => [
__DIR__ . '/src/Spryker/Glue/AppKernel/Plugin/RouteProvider/AppKernelRouteProviderPlugin.php',
],
ClassPropertyAssignToConstructorPromotionRector::class => [
__DIR__ . '/src/Spryker/Zed/AppKernel/Dependency/Client/AppKernelToSecretsManagerClientBridge.php',
__DIR__ . '/src/Spryker/Zed/AppKernel/Dependency/Facade/AppKernelToMessageBrokerFacadeBridge.php',
__DIR__ . '/src/Spryker/Zed/AppKernel/Dependency/Service/AppKernelToUtilEncodingServiceBridge.php',
__DIR__ . '/src/Spryker/Zed/AppKernel/Dependency/Service/AppKernelToUtilTextServiceBridge.php',
__DIR__ . '/src/Spryker/Glue/AppKernel/Dependency/Facade/AppKernelToAppKernelFacadeBridge.php',
__DIR__ . '/src/Spryker/Glue/AppKernel/Dependency/Service/AppKernelToUtilEncodingServiceBridge.php',
__DIR__ . '/src/Spryker/Glue/AppKernel/Dependency/Facade/AppKernelToTranslatorFacadeBridge.php',
],
AddParamTypeFromPropertyTypeRector::class => [
__DIR__ . '/src/Spryker/Zed/AppKernel/Dependency/Client/AppKernelToSecretsManagerClientBridge.php',
__DIR__ . '/src/Spryker/Zed/AppKernel/Dependency/Facade/AppKernelToMessageBrokerFacadeBridge.php',
__DIR__ . '/src/Spryker/Zed/AppKernel/Dependency/Service/AppKernelToUtilEncodingServiceBridge.php',
__DIR__ . '/src/Spryker/Zed/AppKernel/Dependency/Service/AppKernelToUtilTextServiceBridge.php',
__DIR__ . '/src/Spryker/Glue/AppKernel/Dependency/Facade/AppKernelToAppKernelFacadeBridge.php',
__DIR__ . '/src/Spryker/Glue/AppKernel/Dependency/Service/AppKernelToUtilEncodingServiceBridge.php',
__DIR__ . '/src/Spryker/Glue/AppKernel/Dependency/Facade/AppKernelToTranslatorFacadeBridge.php',
],
]);
};