mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-11 19:15:10 +01:00
45 lines
2.0 KiB
PHP
45 lines
2.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Rector\Generic\Rector\ClassMethod\ChangeMethodVisibilityRector;
|
|
use Rector\Generic\ValueObject\ChangeMethodVisibility;
|
|
use Rector\NetteToSymfony\Rector\MethodCall\WrapTransParameterNameRector;
|
|
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
|
|
use Rector\Renaming\Rector\Name\RenameClassRector;
|
|
use Rector\Renaming\ValueObject\MethodCallRename;
|
|
use function Rector\SymfonyPhpConfig\inline_value_objects;
|
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
|
|
|
return static function (ContainerConfigurator $containerConfigurator): void {
|
|
$services = $containerConfigurator->services();
|
|
|
|
$services->set(ChangeMethodVisibilityRector::class)
|
|
->call('configure', [[
|
|
ChangeMethodVisibilityRector::METHOD_VISIBILITIES => inline_value_objects([
|
|
new ChangeMethodVisibility('Kdyby\Events\Subscriber', 'getSubscribedEvents', 'static'),
|
|
]),
|
|
]]);
|
|
|
|
$services->set(RenameMethodRector::class)
|
|
->call('configure', [[
|
|
RenameMethodRector::METHOD_CALL_RENAMES => inline_value_objects([
|
|
new MethodCallRename('Kdyby\Translation\Translator', 'translate', 'trans'),
|
|
new MethodCallRename('Kdyby\RabbitMq\IConsumer', 'process', 'execute'),
|
|
]),
|
|
]]);
|
|
|
|
$services->set(RenameClassRector::class)
|
|
->call('configure', [[
|
|
RenameClassRector::OLD_TO_NEW_CLASSES => [
|
|
'Kdyby\RabbitMq\IConsumer' => 'OldSound\RabbitMqBundle\RabbitMq\ConsumerInterface',
|
|
'Kdyby\RabbitMq\IProducer' => 'OldSound\RabbitMqBundle\RabbitMq\ProducerInterface',
|
|
'Kdyby\Monolog\Logger' => 'Psr\Log\LoggerInterface',
|
|
'Kdyby\Events\Subscriber' => 'Symfony\Component\EventDispatcher\EventSubscriberInterface',
|
|
'Kdyby\Translation\Translator' => 'Symfony\Contracts\Translation\TranslatorInterface',
|
|
],
|
|
]]);
|
|
|
|
$services->set(WrapTransParameterNameRector::class);
|
|
};
|