composer update
This commit is contained in:
parent
f6abc3dce2
commit
71dfaca858
1753 changed files with 45274 additions and 14619 deletions
|
@ -127,13 +127,19 @@ class InlineServiceDefinitionsPass extends AbstractRecursivePass implements Repe
|
|||
}
|
||||
|
||||
$ids = array();
|
||||
$isReferencedByConstructor = false;
|
||||
foreach ($graph->getNode($id)->getInEdges() as $edge) {
|
||||
if ($edge->isWeak()) {
|
||||
$isReferencedByConstructor = $isReferencedByConstructor || $edge->isReferencedByConstructor();
|
||||
if ($edge->isWeak() || $edge->isLazy()) {
|
||||
return false;
|
||||
}
|
||||
$ids[] = $edge->getSourceNode()->getId();
|
||||
}
|
||||
|
||||
if (!$ids) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (\count(array_unique($ids)) > 1) {
|
||||
return false;
|
||||
}
|
||||
|
@ -142,6 +148,10 @@ class InlineServiceDefinitionsPass extends AbstractRecursivePass implements Repe
|
|||
return false;
|
||||
}
|
||||
|
||||
return !$ids || $this->container->getDefinition($ids[0])->isShared();
|
||||
if ($isReferencedByConstructor && $this->container->getDefinition($ids[0])->isLazy() && ($definition->getProperties() || $definition->getMethodCalls() || $definition->getConfigurator())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->container->getDefinition($ids[0])->isShared();
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue