-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrector.php
41 lines (37 loc) · 1.52 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
<?php
use Rector\Core\Configuration\Option;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Wikimedia\Rector\Rectors\MethodParamClassToInterface;
use Wikimedia\Rector\Rectors\RemoveDeprecatedClassesRector;
use Wikimedia\Rector\Rectors\RemoveDeprecatedMethodsRector;
use Wikimedia\Rector\Rectors\RemoveDeprecatedPropertiesRector;
use Wikimedia\Rector\Services\DeprecationParser;
return static function ( ContainerConfigurator $containerConfigurator ) : void {
$parameters = $containerConfigurator->parameters();
$parameters->set( Option::BOOTSTRAP_FILES, [
'includes/AutoLoader.php',
'vendor/autoload.php'
] );
$parameters->set( Option::AUTOLOAD_PATHS, [
//__DIR__ . '/test_code',
'includes/',
'extensions/Echo/includes/',
] );
$parameters->set(Option::AUTO_IMPORT_NAMES, true);
$services = $containerConfigurator->services();
/*$services
->set( DeprecationParser::class )
->call( 'configure', [[
DeprecationParser::REMOVE_SOFT_DEPRECATED => true,
]] )
->autowire();
$services->set( RemoveDeprecatedClassesRector::class );
$services->set( RemoveDeprecatedMethodsRector::class );
$services->set( RemoveDeprecatedPropertiesRector::class );*/
$services
->set( MethodParamClassToInterface::class )
->call( 'configure', [[
MethodParamClassToInterface::REPLACE_CLASS => 'User',
MethodParamClassToInterface::REPLACE_WITH_INTERFACE => '\MediaWiki\User\UserIdentity',
]] );
};