mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-12 11:30:31 +01:00
36 lines
1.4 KiB
PHP
36 lines
1.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Rector\Generic\Rector\ClassMethod\AddReturnTypeDeclarationRector;
|
|
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::TYPEHINT_FOR_METHOD_BY_CLASS => [
|
|
'Doctrine\DBAL\Connection' => [
|
|
'ping' => 'void',
|
|
],
|
|
],
|
|
]]);
|
|
};
|