mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +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:
@@ -23,35 +23,24 @@ use Symfony\Component\DependencyInjection\Reference;
|
||||
*/
|
||||
class ResolveHotPathPass extends AbstractRecursivePass
|
||||
{
|
||||
private $tagName;
|
||||
private $resolvedIds = [];
|
||||
protected bool $skipScalars = true;
|
||||
|
||||
public function __construct(string $tagName = 'container.hot_path')
|
||||
{
|
||||
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)
|
||||
{
|
||||
try {
|
||||
parent::process($container);
|
||||
$container->getDefinition('service_container')->clearTag($this->tagName);
|
||||
$container->getDefinition('service_container')->clearTag('container.hot_path');
|
||||
} finally {
|
||||
$this->resolvedIds = [];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function processValue($value, bool $isRoot = false)
|
||||
protected function processValue(mixed $value, bool $isRoot = false): mixed
|
||||
{
|
||||
if ($value instanceof ArgumentInterface) {
|
||||
return $value;
|
||||
@@ -59,12 +48,12 @@ class ResolveHotPathPass extends AbstractRecursivePass
|
||||
|
||||
if ($value instanceof Definition && $isRoot) {
|
||||
if ($value->isDeprecated()) {
|
||||
return $value->clearTag($this->tagName);
|
||||
return $value->clearTag('container.hot_path');
|
||||
}
|
||||
|
||||
$this->resolvedIds[$this->currentId] = true;
|
||||
|
||||
if (!$value->hasTag($this->tagName)) {
|
||||
if (!$value->hasTag('container.hot_path')) {
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
@@ -72,11 +61,11 @@ class ResolveHotPathPass extends AbstractRecursivePass
|
||||
if ($value instanceof Reference && ContainerBuilder::IGNORE_ON_UNINITIALIZED_REFERENCE !== $value->getInvalidBehavior() && $this->container->hasDefinition($id = (string) $value)) {
|
||||
$definition = $this->container->getDefinition($id);
|
||||
|
||||
if ($definition->isDeprecated() || $definition->hasTag($this->tagName)) {
|
||||
if ($definition->isDeprecated() || $definition->hasTag('container.hot_path')) {
|
||||
return $value;
|
||||
}
|
||||
|
||||
$definition->addTag($this->tagName);
|
||||
$definition->addTag('container.hot_path');
|
||||
|
||||
if (isset($this->resolvedIds[$id])) {
|
||||
parent::processValue($definition, false);
|
||||
|
||||
Reference in New Issue
Block a user