rector/config/set/symfony41.php

68 lines
3.5 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;
use Rector\Renaming\ValueObject\MethodCallRenameWithArrayKey;
use function Rector\SymfonyPhpConfig\inline_value_objects;
2020-07-18 18:57:24 +02:00
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
2020-07-18 19:00:36 +02:00
# https://github.com/symfony/symfony/blob/master/UPGRADE-4.1.md
2020-07-18 18:57:24 +02:00
return static function (ContainerConfigurator $containerConfigurator): void {
$services = $containerConfigurator->services();
$services->set(RenameMethodRector::class)
->call('configure', [[
RenameMethodRector::METHOD_CALL_RENAMES => inline_value_objects([
# https://github.com/symfony/symfony/commit/463f986c28a497571967e37c1314e9911f1ef6ba
new MethodCallRename(
'Symfony\Component\Console\Helper\TableStyle',
'setHorizontalBorderChar',
'setHorizontalBorderChars'
),
# https://github.com/symfony/symfony/commit/463f986c28a497571967e37c1314e9911f1ef6ba
new MethodCallRename(
'Symfony\Component\Console\Helper\TableStyle',
'setVerticalBorderChar',
'setVerticalBorderChars'
),
# https://github.com/symfony/symfony/commit/463f986c28a497571967e37c1314e9911f1ef6ba
new MethodCallRename(
'Symfony\Component\Console\Helper\TableStyle',
'setCrossingChar',
'setDefaultCrossingChar'
),
new MethodCallRename('Symfony\Component\HttpFoundation\File\UploadedFile', 'getClientSize', 'getSize'),
new MethodCallRename('Symfony\Component\Workflow\DefinitionBuilder', 'reset', 'clear'),
new MethodCallRename('Symfony\Component\Workflow\DefinitionBuilder', 'add', 'addWorkflow'),
# https://github.com/symfony/symfony/commit/463f986c28a497571967e37c1314e9911f1ef6ba
new MethodCallRenameWithArrayKey(
'Symfony\Component\Console\Helper\TableStyle',
'getVerticalBorderChar',
# special case to "getVerticalBorderChar" → "getBorderChars()[3]"
'getBorderChars',
3
),
# https://github.com/symfony/symfony/commit/463f986c28a497571967e37c1314e9911f1ef6ba
new MethodCallRenameWithArrayKey(
'Symfony\Component\Console\Helper\TableStyle',
'getHorizontalBorderChar',
'getBorderChars',
2
),
]),
]]);
2020-07-18 18:57:24 +02:00
$services->set(RenameClassRector::class)
->call('configure', [[
2020-07-30 01:39:41 +02:00
RenameClassRector::OLD_TO_NEW_CLASSES => [
# https://github.com/symfony/symfony/commit/07dd09db59e2f2a86a291d00d978169d9059e307
'Symfony\Bundle\FrameworkBundle\DataCollector\RequestDataCollector' => 'Symfony\Component\HttpKernel\DataCollector\RequestDataCollector',
'Symfony\Component\Workflow\SupportStrategy\SupportStrategyInterface' => 'Symfony\Component\Workflow\SupportStrategy\WorkflowSupportStrategyInterface',
'Symfony\Component\Workflow\SupportStrategy\ClassInstanceSupportStrategy' => 'Symfony\Component\Workflow\SupportStrategy\InstanceOfSupportStrategy',
],
]]);
2020-07-18 18:57:24 +02:00
};