mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-22 10:08:45 +02:00
N°6934 - Symfony 6.4 - upgrade Symfony bundles to 6.4 (#580)
* Update Symfony lib to version ~6.4.0 * Update code missing return type * Add an iTop general configuration entry to store application secret (Symfony mandatory parameter) * Use dependency injection in ExceptionListener & UserProvider classes
This commit is contained in:
@@ -21,6 +21,9 @@ use Symfony\Component\DependencyInjection\Reference;
|
||||
*/
|
||||
class TestServiceContainerRealRefPass implements CompilerPassInterface
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function process(ContainerBuilder $container)
|
||||
{
|
||||
if (!$container->hasDefinition('test.private_services_locator')) {
|
||||
@@ -30,10 +33,17 @@ class TestServiceContainerRealRefPass implements CompilerPassInterface
|
||||
$privateContainer = $container->getDefinition('test.private_services_locator');
|
||||
$definitions = $container->getDefinitions();
|
||||
$privateServices = $privateContainer->getArgument(0);
|
||||
$renamedIds = [];
|
||||
|
||||
foreach ($privateServices as $id => $argument) {
|
||||
if (isset($definitions[$target = (string) $argument->getValues()[0]])) {
|
||||
$argument->setValues([new Reference($target)]);
|
||||
if ($id !== $target) {
|
||||
$renamedIds[$id] = $target;
|
||||
}
|
||||
if ($inner = $definitions[$target]->getTag('container.decorator')[0]['inner'] ?? null) {
|
||||
$renamedIds[$id] = $inner;
|
||||
}
|
||||
} else {
|
||||
unset($privateServices[$id]);
|
||||
}
|
||||
@@ -47,8 +57,14 @@ class TestServiceContainerRealRefPass implements CompilerPassInterface
|
||||
if ($definitions[$target]->hasTag('container.private')) {
|
||||
$privateServices[$id] = new ServiceClosureArgument(new Reference($target));
|
||||
}
|
||||
|
||||
$renamedIds[$id] = $target;
|
||||
}
|
||||
|
||||
$privateContainer->replaceArgument(0, $privateServices);
|
||||
|
||||
if ($container->hasDefinition('test.service_container') && $renamedIds) {
|
||||
$container->getDefinition('test.service_container')->setArgument(2, $renamedIds);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user