mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-27 12:38:44 +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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user