2020-07-18 18:57:24 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2020-07-29 01:41:20 +02:00
|
|
|
use Rector\Generic\Rector\ClassMethod\AddReturnTypeDeclarationRector;
|
2020-09-12 23:19:08 +02:00
|
|
|
use Rector\Generic\ValueObject\AddReturnTypeDeclaration;
|
2020-07-18 18:57:24 +02:00
|
|
|
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
|
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;
|
|
|
|
|
2020-07-18 19:00:36 +02:00
|
|
|
# https://github.com/doctrine/dbal/blob/master/UPGRADE.md#bc-break-changes-in-handling-string-and-binary-columns
|
2020-07-18 18:57:24 +02:00
|
|
|
return static function (ContainerConfigurator $containerConfigurator): void {
|
|
|
|
$services = $containerConfigurator->services();
|
|
|
|
|
|
|
|
$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(
|
|
|
|
'DBAL\Platforms\AbstractPlatform',
|
|
|
|
'getVarcharTypeDeclarationSQL',
|
|
|
|
'getStringTypeDeclarationSQL'
|
|
|
|
),
|
|
|
|
new MethodCallRename('Doctrine\DBAL\Driver\DriverException', 'getErrorCode', 'getCode'),
|
|
|
|
]),
|
2020-07-30 00:43:06 +02:00
|
|
|
]]);
|
2020-07-18 18:57:24 +02:00
|
|
|
|
|
|
|
$services->set(AddReturnTypeDeclarationRector::class)
|
2020-07-30 00:43:06 +02:00
|
|
|
->call('configure', [[
|
2020-08-25 20:34:49 +02:00
|
|
|
AddReturnTypeDeclarationRector::METHOD_RETURN_TYPES => inline_value_objects([
|
2020-09-12 23:19:08 +02:00
|
|
|
new AddReturnTypeDeclaration('Doctrine\DBAL\Connection', 'ping', 'void'),
|
2020-08-25 20:34:49 +02:00
|
|
|
]),
|
2020-07-30 00:43:06 +02:00
|
|
|
]]);
|
2020-07-18 18:57:24 +02:00
|
|
|
};
|