Skip to content

Commit 1928bc7

Browse files
bug #27528 [FrameworkBundle] give access to non-shared services when using test.service_container (nicolas-grekas)
This PR was merged into the 4.1 branch. Discussion ---------- [FrameworkBundle] give access to non-shared services when using test.service_container | Q | A | ------------- | --- | Branch? | 4.1 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #27488 | License | MIT | Doc PR | - Commits ------- 516ff5a985 [FrameworkBundle] give access to non-shared services when using test.service_container
2 parents a4350db + 7d6490b commit 1928bc7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Compiler/InlineServiceDefinitionsPass.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ private function isInlineableDefinition($id, Definition $definition, ServiceRefe
9393
}
9494

9595
if (!$definition->isShared()) {
96+
foreach ($graph->getNode($id)->getInEdges() as $edge) {
97+
if ($edge->isWeak()) {
98+
return false;
99+
}
100+
}
101+
96102
return true;
97103
}
98104

0 commit comments

Comments
 (0)