mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-12 11:30:31 +01:00
* 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>
43 lines
1.6 KiB
PHP
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,
|
|
],
|
|
],
|
|
],
|
|
]]);
|
|
};
|