Skip to content

Commit 1d01452

Browse files
[DependencyInjection] Fix dump order of inlined deps
1 parent 8cf82db commit 1d01452

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ private function collectCircularReferences(string $sourceId, array $edges, array
497497
$loop = [];
498498
}
499499
}
500-
$this->addCircularReferences($first, $loop, true);
500+
$this->addCircularReferences($first, $loop, $loopByConstructor);
501501
break;
502502
}
503503
}

src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_almost_circular_private.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -421,17 +421,16 @@ protected function getMonologInline_LoggerService()
421421
*/
422422
protected function getPAService()
423423
{
424-
$a = new \stdClass();
425-
426-
$b = ($this->privates['pC'] ?? $this->getPCService());
424+
$a = ($this->privates['pC'] ?? $this->getPCService());
427425

428426
if (isset($this->services['pA'])) {
429427
return $this->services['pA'];
430428
}
429+
$b = new \stdClass();
431430

432-
$this->services['pA'] = $instance = new \stdClass($a, $b);
431+
$this->services['pA'] = $instance = new \stdClass($b, $a);
433432

434-
$a->d = ($this->privates['pD'] ?? $this->getPDService());
433+
$b->d = ($this->privates['pD'] ?? $this->getPDService());
435434

436435
return $instance;
437436
}

0 commit comments

Comments
 (0)