function PhpDumper::isSingleUsePrivateNode
1 call to PhpDumper::isSingleUsePrivateNode()
- PhpDumper::analyzeReferences in vendor/
symfony/ dependency-injection/ Dumper/ PhpDumper.php
File
-
vendor/
symfony/ dependency-injection/ Dumper/ PhpDumper.php, line 2187
Class
- PhpDumper
- PhpDumper dumps a service container as a PHP class.
Namespace
Symfony\Component\DependencyInjection\DumperCode
private function isSingleUsePrivateNode(ServiceReferenceGraphNode $node) : bool {
if ($node->getValue()
->isPublic()) {
return false;
}
$ids = [];
foreach ($node->getInEdges() as $edge) {
if (!($value = $edge->getSourceNode()
->getValue())) {
continue;
}
if ($edge->isLazy() || !$value instanceof Definition || !$value->isShared()) {
return false;
}
$ids[$edge->getSourceNode()
->getId()] = true;
}
return 1 === \count($ids);
}