rector/config/set/symfony50.php

37 lines
1.3 KiB
PHP
Raw Normal View History

2020-07-18 18:57:24 +02:00
<?php
declare(strict_types=1);
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
use Rector\Renaming\Rector\Name\RenameClassRector;
use Rector\Renaming\ValueObject\MethodCallRename;
2020-07-18 18:57:24 +02:00
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\SymfonyPhpConfig\ValueObjectInliner;
2020-07-18 18:57:24 +02:00
2020-07-18 19:00:36 +02:00
# https://github.com/symfony/symfony/blob/5.0/UPGRADE-5.0.md
2020-07-18 18:57:24 +02:00
return static function (ContainerConfigurator $containerConfigurator): void {
$containerConfigurator->import(__DIR__ . '/symfony50-types.php');
$services = $containerConfigurator->services();
$services->set(RenameClassRector::class)
->call('configure', [[
2020-07-30 01:39:41 +02:00
RenameClassRector::OLD_TO_NEW_CLASSES => [
'Symfony\Component\Debug\Debug' => 'Symfony\Component\ErrorHandler\Debug',
],
]]);
2020-07-18 18:57:24 +02:00
$services->set(RenameMethodRector::class)
->call('configure', [[
RenameMethodRector::METHOD_CALL_RENAMES => ValueObjectInliner::inline([
new MethodCallRename('Symfony\Component\Console\Application', 'renderException', 'renderThrowable'),
new MethodCallRename(
'Symfony\Component\Console\Application',
'doRenderException',
'doRenderThrowable'
),
]),
]]);
2020-07-18 18:57:24 +02:00
};