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:
@@ -24,19 +24,24 @@ use Symfony\Component\DependencyInjection\Reference;
|
||||
*/
|
||||
class InlineServiceDefinitionsPass extends AbstractRecursivePass
|
||||
{
|
||||
private $analyzingPass;
|
||||
private $cloningIds = [];
|
||||
private $connectedIds = [];
|
||||
private $notInlinedIds = [];
|
||||
private $inlinedIds = [];
|
||||
private $notInlinableIds = [];
|
||||
private $graph;
|
||||
protected bool $skipScalars = true;
|
||||
|
||||
private ?AnalyzeServiceReferencesPass $analyzingPass;
|
||||
private array $cloningIds = [];
|
||||
private array $connectedIds = [];
|
||||
private array $notInlinedIds = [];
|
||||
private array $inlinedIds = [];
|
||||
private array $notInlinableIds = [];
|
||||
private ?ServiceReferenceGraph $graph = null;
|
||||
|
||||
public function __construct(AnalyzeServiceReferencesPass $analyzingPass = null)
|
||||
{
|
||||
$this->analyzingPass = $analyzingPass;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function process(ContainerBuilder $container)
|
||||
{
|
||||
$this->container = $container;
|
||||
@@ -51,6 +56,7 @@ class InlineServiceDefinitionsPass extends AbstractRecursivePass
|
||||
$analyzedContainer = $container;
|
||||
}
|
||||
try {
|
||||
$notInlinableIds = [];
|
||||
$remainingInlinedIds = [];
|
||||
$this->connectedIds = $this->notInlinedIds = $container->getDefinitions();
|
||||
do {
|
||||
@@ -60,7 +66,8 @@ class InlineServiceDefinitionsPass extends AbstractRecursivePass
|
||||
}
|
||||
$this->graph = $analyzedContainer->getCompiler()->getServiceReferenceGraph();
|
||||
$notInlinedIds = $this->notInlinedIds;
|
||||
$this->connectedIds = $this->notInlinedIds = $this->inlinedIds = [];
|
||||
$notInlinableIds += $this->notInlinableIds;
|
||||
$this->connectedIds = $this->notInlinedIds = $this->inlinedIds = $this->notInlinableIds = [];
|
||||
|
||||
foreach ($analyzedContainer->getDefinitions() as $id => $definition) {
|
||||
if (!$this->graph->hasNode($id)) {
|
||||
@@ -86,7 +93,7 @@ class InlineServiceDefinitionsPass extends AbstractRecursivePass
|
||||
} while ($this->inlinedIds && $this->analyzingPass);
|
||||
|
||||
foreach ($remainingInlinedIds as $id) {
|
||||
if (isset($this->notInlinableIds[$id])) {
|
||||
if (isset($notInlinableIds[$id])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -104,10 +111,7 @@ class InlineServiceDefinitionsPass extends AbstractRecursivePass
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function processValue($value, bool $isRoot = false)
|
||||
protected function processValue(mixed $value, bool $isRoot = false): mixed
|
||||
{
|
||||
if ($value instanceof ArgumentInterface) {
|
||||
// References found in ArgumentInterface::getValues() are not inlineable
|
||||
@@ -129,8 +133,10 @@ class InlineServiceDefinitionsPass extends AbstractRecursivePass
|
||||
|
||||
$definition = $this->container->getDefinition($id);
|
||||
|
||||
if (!$this->isInlineableDefinition($id, $definition)) {
|
||||
$this->notInlinableIds[$id] = true;
|
||||
if (isset($this->notInlinableIds[$id]) || !$this->isInlineableDefinition($id, $definition)) {
|
||||
if ($this->currentId !== $id) {
|
||||
$this->notInlinableIds[$id] = true;
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
@@ -191,7 +197,7 @@ class InlineServiceDefinitionsPass extends AbstractRecursivePass
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($this->currentId == $id) {
|
||||
if ($this->currentId === $id) {
|
||||
return false;
|
||||
}
|
||||
$this->connectedIds[$id] = true;
|
||||
|
||||
Reference in New Issue
Block a user