-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathrector.php
46 lines (43 loc) · 2.14 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
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\Privatization\Rector\ClassMethod\PrivatizeFinalClassMethodRector;
use Rector\Set\ValueObject\LevelSetList;
use Rector\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector;
use Rector\TypeDeclaration\Rector\ClassMethod\AddParamTypeDeclarationRector;
use Rector\TypeDeclaration\Rector\ClassMethod\AddParamTypeFromPropertyTypeRector;
use Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictNativeCallRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictScalarReturnExprRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictTypedPropertyRector;
use Rector\TypeDeclaration\Rector\Property\AddPropertyTypeDeclarationRector;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictSetUpRector;
use Rector\TypeDeclaration\Rector\StmtsAwareInterface\DeclareStrictTypesRector;
return RectorConfig::configure()
->withPaths([
__DIR__ . '/src',
__DIR__ . '/tests',
])
// uncomment to reach your current PHP version
//->withPhpSets()
->withSets([
LevelSetList::UP_TO_PHP_74,
])
->withRules([
AddVoidReturnTypeWhereNoReturnRector::class,
TypedPropertyFromAssignsRector::class,
TypedPropertyFromStrictConstructorRector::class,
TypedPropertyFromStrictSetUpRector::class,
PrivatizeFinalClassMethodRector::class,
DeclareStrictTypesRector::class,
ReturnTypeFromStrictTypedPropertyRector::class,
AddMethodCallBasedStrictParamTypeRector::class,
AddParamTypeFromPropertyTypeRector::class,
ReturnTypeFromStrictNativeCallRector::class,
ReturnTypeFromStrictScalarReturnExprRector::class,
])
//->withConfiguredRule(AddPropertyTypeDeclarationRector::class, [])
->withConfiguredRule(AddParamTypeDeclarationRector::class, [])
->withImportNames(true, true, false);