Skip to content

Commit

Permalink
bug #48971 [DependencyInjection] Fix dump order of inlined deps (nico…
Browse files Browse the repository at this point in the history
…las-grekas)

This PR was merged into the 5.4 branch.

Discussion
----------

[DependencyInjection] Fix dump order of inlined deps

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #48895
| License       | MIT
| Doc PR        | -

Fix confirmed on the provided reproducers.
The updated fixture makes more sense also.

Commits
-------

1d01452 [DependencyInjection] Fix dump order of inlined deps
  • Loading branch information
nicolas-grekas committed Jan 13, 2023
2 parents 3c154c7 + 1d01452 commit dd23b8b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Expand Up @@ -497,7 +497,7 @@ private function collectCircularReferences(string $sourceId, array $edges, array
$loop = [];
}
}
$this->addCircularReferences($first, $loop, true);
$this->addCircularReferences($first, $loop, $loopByConstructor);
break;
}
}
Expand Down
Expand Up @@ -421,17 +421,16 @@ protected function getMonologInline_LoggerService()
*/
protected function getPAService()
{
$a = new \stdClass();

$b = ($this->privates['pC'] ?? $this->getPCService());
$a = ($this->privates['pC'] ?? $this->getPCService());

if (isset($this->services['pA'])) {
return $this->services['pA'];
}
$b = new \stdClass();

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

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

return $instance;
}
Expand Down

0 comments on commit dd23b8b

Please sign in to comment.