[DI] Minor dumping logic simplification

This commit is contained in:
Nicolas Grekas 2017-07-17 22:48:54 +02:00
parent 5c2797afd3
commit 37d8495a59

View File

@ -1608,7 +1608,7 @@ EOF;
$code = sprintf('$this->get(\'%s\')', $id);
}
if ($this->container->hasDefinition($id) && (!$this->container->getDefinition($id)->isPublic() || $this->container->getDefinition($id)->isShared())) {
if ($this->container->hasDefinition($id) && $this->container->getDefinition($id)->isShared()) {
// The following is PHP 5.5 syntax for what could be written as "(\$this->services['$id'] ?? $code)" on PHP>=7.0
$code = "\${(\$_ = isset(\$this->services['$id']) ? \$this->services['$id'] : $code) && false ?: '_'}";