forked from rectorphp/rector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
privatization.php
34 lines (29 loc) · 1.92 KB
/
privatization.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
<?php
declare(strict_types=1);
use Rector\Privatization\Rector\Class_\ChangeLocalPropertyToVariableRector;
use Rector\Privatization\Rector\Class_\ChangeReadOnlyVariableWithDefaultValueToConstantRector;
use Rector\Privatization\Rector\Class_\FinalizeClassesWithoutChildrenRector;
use Rector\Privatization\Rector\Class_\MakeUnusedClassesWithChildrenAbstractRector;
use Rector\Privatization\Rector\Class_\RepeatedLiteralToClassConstantRector;
use Rector\Privatization\Rector\ClassMethod\ChangeGlobalVariablesToPropertiesRector;
use Rector\Privatization\Rector\ClassMethod\PrivatizeFinalClassMethodRector;
use Rector\Privatization\Rector\MethodCall\PrivatizeLocalGetterToPropertyRector;
use Rector\Privatization\Rector\Property\ChangeReadOnlyPropertyWithDefaultValueToConstantRector;
use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector;
use Rector\Privatization\Rector\Property\PrivatizeLocalPropertyToPrivatePropertyRector;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $containerConfigurator): void {
$services = $containerConfigurator->services();
$services->set(MakeUnusedClassesWithChildrenAbstractRector::class);
$services->set(FinalizeClassesWithoutChildrenRector::class);
$services->set(ChangeGlobalVariablesToPropertiesRector::class);
$services->set(ChangeReadOnlyPropertyWithDefaultValueToConstantRector::class);
$services->set(ChangeReadOnlyVariableWithDefaultValueToConstantRector::class);
$services->set(RepeatedLiteralToClassConstantRector::class);
$services->set(PrivatizeLocalGetterToPropertyRector::class);
$services->set(PrivatizeLocalPropertyToPrivatePropertyRector::class);
$services->set(PrivatizeFinalClassPropertyRector::class);
$services->set(PrivatizeFinalClassMethodRector::class);
// buggy, requires more work
// $services->set(ChangeLocalPropertyToVariableRector::class);
};