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:
bdalsass
2023-12-05 13:56:56 +01:00
committed by GitHub
parent 863ab4560c
commit 27ce51ab07
1392 changed files with 44869 additions and 27799 deletions

View File

@@ -26,7 +26,7 @@ use Symfony\Component\HttpKernel\KernelInterface;
*/
trait BuildDebugContainerTrait
{
protected $containerBuilder;
protected ContainerBuilder $container;
/**
* Loads the ContainerBuilder from the cache.
@@ -35,22 +35,29 @@ trait BuildDebugContainerTrait
*/
protected function getContainerBuilder(KernelInterface $kernel): ContainerBuilder
{
if ($this->containerBuilder) {
return $this->containerBuilder;
if (isset($this->container)) {
return $this->container;
}
if (!$kernel->isDebug() || !(new ConfigCache($kernel->getContainer()->getParameter('debug.container.dump'), true))->isFresh()) {
if (!$kernel->isDebug() || !$kernel->getContainer()->getParameter('debug.container.dump') || !(new ConfigCache($kernel->getContainer()->getParameter('debug.container.dump'), true))->isFresh()) {
$buildContainer = \Closure::bind(function () {
$this->initializeBundles();
return $this->buildContainer();
}, $kernel, \get_class($kernel));
}, $kernel, $kernel::class);
$container = $buildContainer();
$container->getCompilerPassConfig()->setRemovingPasses([]);
$container->getCompilerPassConfig()->setAfterRemovingPasses([]);
$container->compile();
} else {
(new XmlFileLoader($container = new ContainerBuilder(), new FileLocator()))->load($kernel->getContainer()->getParameter('debug.container.dump'));
$buildContainer = \Closure::bind(function () {
$containerBuilder = $this->getContainerBuilder();
$this->prepareContainer($containerBuilder);
return $containerBuilder;
}, $kernel, $kernel::class);
$container = $buildContainer();
(new XmlFileLoader($container, new FileLocator()))->load($kernel->getContainer()->getParameter('debug.container.dump'));
$locatorPass = new ServiceLocatorTagPass();
$locatorPass->process($container);
@@ -59,6 +66,6 @@ trait BuildDebugContainerTrait
$container->getCompilerPassConfig()->setBeforeRemovingPasses([]);
}
return $this->containerBuilder = $container;
return $this->container = $container;
}
}