2020-07-18 18:57:24 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2020-08-18 17:57:30 +02:00
|
|
|
use Rector\Generic\Rector\ClassMethod\ChangeMethodVisibilityRector;
|
2020-09-12 23:19:08 +02:00
|
|
|
use Rector\Generic\ValueObject\ChangeMethodVisibility;
|
2020-07-18 18:57:24 +02:00
|
|
|
use Rector\NetteToSymfony\Rector\MethodCall\WrapTransParameterNameRector;
|
|
|
|
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
|
2020-08-18 17:57:30 +02:00
|
|
|
use Rector\Renaming\Rector\Name\RenameClassRector;
|
2020-08-25 00:26:14 +02:00
|
|
|
use Rector\Renaming\ValueObject\MethodCallRename;
|
|
|
|
use function Rector\SymfonyPhpConfig\inline_value_objects;
|
2020-07-18 18:57:24 +02:00
|
|
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
|
|
|
|
|
|
|
return static function (ContainerConfigurator $containerConfigurator): void {
|
|
|
|
$services = $containerConfigurator->services();
|
|
|
|
|
|
|
|
$services->set(ChangeMethodVisibilityRector::class)
|
2020-07-30 00:43:06 +02:00
|
|
|
->call('configure', [[
|
2020-08-25 21:19:12 +02:00
|
|
|
ChangeMethodVisibilityRector::METHOD_VISIBILITIES => inline_value_objects([
|
2020-09-12 23:19:08 +02:00
|
|
|
new ChangeMethodVisibility('Kdyby\Events\Subscriber', 'getSubscribedEvents', 'static'),
|
2020-08-25 21:19:12 +02:00
|
|
|
]),
|
2020-07-30 00:43:06 +02:00
|
|
|
]]);
|
2020-07-18 18:57:24 +02:00
|
|
|
|
|
|
|
$services->set(RenameMethodRector::class)
|
2020-07-30 00:43:06 +02:00
|
|
|
->call('configure', [[
|
2020-08-25 00:37:12 +02:00
|
|
|
RenameMethodRector::METHOD_CALL_RENAMES => inline_value_objects([
|
2020-08-25 00:26:14 +02:00
|
|
|
new MethodCallRename('Kdyby\Translation\Translator', 'translate', 'trans'),
|
|
|
|
new MethodCallRename('Kdyby\RabbitMq\IConsumer', 'process', 'execute'),
|
|
|
|
]),
|
2020-07-30 00:43:06 +02:00
|
|
|
]]);
|
2020-07-18 18:57:24 +02:00
|
|
|
|
|
|
|
$services->set(RenameClassRector::class)
|
2020-07-30 00:43:06 +02:00
|
|
|
->call('configure', [[
|
2020-07-30 01:39:41 +02:00
|
|
|
RenameClassRector::OLD_TO_NEW_CLASSES => [
|
2020-07-30 00:43:06 +02:00
|
|
|
'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',
|
|
|
|
],
|
|
|
|
]]);
|
2020-07-18 18:57:24 +02:00
|
|
|
|
|
|
|
$services->set(WrapTransParameterNameRector::class);
|
|
|
|
};
|