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:
@@ -24,20 +24,12 @@ class ResolveNoPreloadPass extends AbstractRecursivePass
|
||||
{
|
||||
private const DO_PRELOAD_TAG = '.container.do_preload';
|
||||
|
||||
private $tagName;
|
||||
private $resolvedIds = [];
|
||||
protected bool $skipScalars = true;
|
||||
|
||||
public function __construct(string $tagName = 'container.no_preload')
|
||||
{
|
||||
if (0 < \func_num_args()) {
|
||||
trigger_deprecation('symfony/dependency-injection', '5.3', 'Configuring "%s" is deprecated.', __CLASS__);
|
||||
}
|
||||
|
||||
$this->tagName = $tagName;
|
||||
}
|
||||
private array $resolvedIds = [];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
* @return void
|
||||
*/
|
||||
public function process(ContainerBuilder $container)
|
||||
{
|
||||
@@ -66,15 +58,12 @@ class ResolveNoPreloadPass extends AbstractRecursivePass
|
||||
if ($definition->hasTag(self::DO_PRELOAD_TAG)) {
|
||||
$definition->clearTag(self::DO_PRELOAD_TAG);
|
||||
} elseif (!$definition->isDeprecated() && !$definition->hasErrors()) {
|
||||
$definition->addTag($this->tagName);
|
||||
$definition->addTag('container.no_preload');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function processValue($value, bool $isRoot = false)
|
||||
protected function processValue(mixed $value, bool $isRoot = false): mixed
|
||||
{
|
||||
if ($value instanceof Reference && ContainerBuilder::IGNORE_ON_UNINITIALIZED_REFERENCE !== $value->getInvalidBehavior() && $this->container->hasDefinition($id = (string) $value)) {
|
||||
$definition = $this->container->getDefinition($id);
|
||||
@@ -91,7 +80,7 @@ class ResolveNoPreloadPass extends AbstractRecursivePass
|
||||
return parent::processValue($value, $isRoot);
|
||||
}
|
||||
|
||||
if ($value->hasTag($this->tagName) || $value->isDeprecated() || $value->hasErrors()) {
|
||||
if ($value->hasTag('container.no_preload') || $value->isDeprecated() || $value->hasErrors()) {
|
||||
return $value;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user