rector/config/set/doctrine25.php
Tomas Votruba 35f61c64b6
[objectize] moving parameter typehint to objects (#4019)
* moving parameter typehint to objects

* rename constnats

* add support for nested configs

* switch to param type value object

* [rector] switch to param type value object

Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-25 02:21:00 +02:00

43 lines
1.6 KiB
PHP

<?php
declare(strict_types=1);
use Rector\Generic\Rector\ClassMethod\ArgumentRemoverRector;
use function Rector\SymfonyPhpConfig\inline_value_objects;
use Rector\TypeDeclaration\Rector\ClassMethod\AddParamTypeDeclarationRector;
use Rector\TypeDeclaration\ValueObject\ParameterTypehint;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $containerConfigurator): void {
$services = $containerConfigurator->services();
$services->set(AddParamTypeDeclarationRector::class)
->call('configure', [[
AddParamTypeDeclarationRector::PARAMETER_TYPEHINTS => inline_value_objects([
new ParameterTypehint(
'Doctrine\ORM\Mapping\ClassMetadataFactory',
'setEntityManager',
0,
'Doctrine\ORM\EntityManagerInterface'
),
new ParameterTypehint(
'Doctrine\ORM\Tools\DebugUnitOfWorkListener',
'dumpIdentityMap',
0,
'Doctrine\ORM\EntityManagerInterface'
),
]),
]]);
$services->set(ArgumentRemoverRector::class)
->call('configure', [[
ArgumentRemoverRector::POSITIONS_BY_METHOD_NAME_BY_CLASS_TYPE => [
'Doctrine\ORM\Persisters\Entity\AbstractEntityInheritancePersister' => [
'getSelectJoinColumnSQL' => [
4 => null,
],
],
],
]]);
};