forked from api-platform/core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrector.php
69 lines (62 loc) · 2.49 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
63
64
65
66
67
68
69
<?php
/*
* This file is part of the API Platform project.
*
* (c) Kévin Dunglas <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\StaticCall\RemoveParentCallWithoutParentRector;
use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector;
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
use Rector\PHPUnit\Rector\Class_\AddSeeTestAnnotationRector;
use Rector\PHPUnit\Rector\MethodCall\AssertEqualsToSameRector;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
use Rector\TypeDeclaration\Rector\ClassMethod\ArrayShapeFromConstantArrayReturnRector;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
__DIR__.'/src',
__DIR__.'/tests',
]);
$rectorConfig->skip([
__DIR__.'/tests/Fixtures/app/var',
AddSeeTestAnnotationRector::class,
ArrayShapeFromConstantArrayReturnRector::class,
NullToStrictStringFuncCallArgRector::class,
ReadOnlyPropertyRector::class => [
__DIR__.'/tests/Fixtures/TestBundle/Document',
__DIR__.'/tests/Fixtures/TestBundle/Entity',
],
RemoveParentCallWithoutParentRector::class => [
__DIR__.'/tests/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaChoiceRestrictionTest.php',
],
RenameMethodRector::class => [
__DIR__.'/tests/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaChoiceRestrictionTest.php',
],
AssertEqualsToSameRector::class,
]);
$rectorConfig->phpstanConfig(__DIR__.'/phpstan.neon.dist');
$rectorConfig->importNames();
$rectorConfig->importShortClasses(false);
$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_81,
SetList::TYPE_DECLARATION_STRICT,
]);
// PHPUnit
$rectorConfig->sets([
PHPUnitSetList::PHPUNIT_91,
PHPUnitSetList::PHPUNIT_CODE_QUALITY,
PHPUnitSetList::PHPUNIT_EXCEPTION,
PHPUnitSetList::REMOVE_MOCKS,
PHPUnitSetList::PHPUNIT_SPECIFIC_METHOD,
PHPUnitSetList::PHPUNIT_YIELD_DATA_PROVIDER,
]);
};