Skip to content

Commit 831b00f

Browse files
bug #33958 [DI] Add extra type check to php dumper (gquemener)
This PR was merged into the 4.3 branch. Discussion ---------- [DI] Add extra type check to php dumper | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #33942 | License | MIT | Doc PR This PR adds a missing type check in the PHP Dumper. The bug has been detected while working on the https://github.com/prooph/service-bus-symfony-bundle and I haven't been able to reproduce it within a minimalist testcase. I would like to add a unit test to cover it once I have figured out the exact context in which the bug occurs. Any help would be greatly appreciated to do so, especially from "senior" contributors of the DependencyInjection component, many thanks in advance! You will find more information about this bug in the linked ticket above. Commits ------- b17ebdf bug #33942 [DI] Add extra type check to php dumper
2 parents 8d8a10c + b17ebdf commit 831b00f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1889,7 +1889,7 @@ private function isSingleUsePrivateNode(ServiceReferenceGraphNode $node): bool
18891889
if (!$value = $edge->getSourceNode()->getValue()) {
18901890
continue;
18911891
}
1892-
if ($edge->isLazy() || !$value->isShared()) {
1892+
if ($edge->isLazy() || !$value instanceof Definition || !$value->isShared()) {
18931893
return false;
18941894
}
18951895
$ids[$edge->getSourceNode()->getId()] = true;

0 commit comments

Comments
 (0)