mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-11 19:15:10 +01:00
35 lines
1.4 KiB
PHP
35 lines
1.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Rector\Generic\Rector\ClassMethod\AddReturnTypeDeclarationRector;
|
|
use Rector\Generic\ValueObject\AddReturnTypeDeclaration;
|
|
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
|
|
use Rector\Renaming\ValueObject\MethodCallRename;
|
|
use function Rector\SymfonyPhpConfig\inline_value_objects;
|
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
|
|
|
# https://github.com/doctrine/dbal/blob/master/UPGRADE.md#bc-break-changes-in-handling-string-and-binary-columns
|
|
return static function (ContainerConfigurator $containerConfigurator): void {
|
|
$services = $containerConfigurator->services();
|
|
|
|
$services->set(RenameMethodRector::class)
|
|
->call('configure', [[
|
|
RenameMethodRector::METHOD_CALL_RENAMES => inline_value_objects([
|
|
new MethodCallRename(
|
|
'DBAL\Platforms\AbstractPlatform',
|
|
'getVarcharTypeDeclarationSQL',
|
|
'getStringTypeDeclarationSQL'
|
|
),
|
|
new MethodCallRename('Doctrine\DBAL\Driver\DriverException', 'getErrorCode', 'getCode'),
|
|
]),
|
|
]]);
|
|
|
|
$services->set(AddReturnTypeDeclarationRector::class)
|
|
->call('configure', [[
|
|
AddReturnTypeDeclarationRector::METHOD_RETURN_TYPES => inline_value_objects([
|
|
new AddReturnTypeDeclaration('Doctrine\DBAL\Connection', 'ping', 'void'),
|
|
]),
|
|
]]);
|
|
};
|