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

@@ -29,12 +29,14 @@ use Symfony\Component\DependencyInjection\TypedReference;
*/
class ResolveInvalidReferencesPass implements CompilerPassInterface
{
private $container;
private $signalingException;
private $currentId;
private ContainerBuilder $container;
private RuntimeException $signalingException;
private string $currentId;
/**
* Process the ContainerBuilder to resolve invalid references.
*
* @return void
*/
public function process(ContainerBuilder $container)
{
@@ -46,18 +48,16 @@ class ResolveInvalidReferencesPass implements CompilerPassInterface
$this->processValue($definition);
}
} finally {
$this->container = $this->signalingException = null;
unset($this->container, $this->signalingException);
}
}
/**
* Processes arguments to determine invalid references.
*
* @return mixed
*
* @throws RuntimeException When an invalid reference is found
*/
private function processValue($value, int $rootLevel = 0, int $level = 0)
private function processValue(mixed $value, int $rootLevel = 0, int $level = 0): mixed
{
if ($value instanceof ServiceClosureArgument) {
$value->setValues($this->processValue($value->getValues(), 1, 1));
@@ -97,7 +97,7 @@ class ResolveInvalidReferencesPass implements CompilerPassInterface
$value = array_values($value);
}
} elseif ($value instanceof Reference) {
if ($this->container->has($id = (string) $value)) {
if ($this->container->hasDefinition($id = (string) $value) ? !$this->container->getDefinition($id)->hasTag('container.excluded') : $this->container->hasAlias($id)) {
return $value;
}