Skip to content

Commit 267970e

Browse files
minor symfony#23560 [DI] Minor dumping logic simplification (nicolas-grekas)
This PR was merged into the 3.3 branch. Discussion ---------- [DI] Minor dumping logic simplification | Q | A | ------------- | --- | Branch? | 3.3 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Likely not a bug fix because private services should be dealt with by some compiler pass, but anyway, locally, I don't get why non-shared private services should check the "$this->services" property. Did I miss something? Commits ------- 37d8495 [DI] Minor dumping logic simplification
2 parents 5c2797a + 37d8495 commit 267970e

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
@@ -1608,7 +1608,7 @@ private function getServiceCall($id, Reference $reference = null)
16081608
$code = sprintf('$this->get(\'%s\')', $id);
16091609
}
16101610

1611-
if ($this->container->hasDefinition($id) && (!$this->container->getDefinition($id)->isPublic() || $this->container->getDefinition($id)->isShared())) {
1611+
if ($this->container->hasDefinition($id) && $this->container->getDefinition($id)->isShared()) {
16121612
// The following is PHP 5.5 syntax for what could be written as "(\$this->services['$id'] ?? $code)" on PHP>=7.0
16131613

16141614
$code = "\${(\$_ = isset(\$this->services['$id']) ? \$this->services['$id'] : $code) && false ?: '_'}";

0 commit comments

Comments
 (0)