function ServiceReferenceGraph::connect
Connects 2 nodes together in the Graph.
File
-
vendor/
symfony/ dependency-injection/ Compiler/ ServiceReferenceGraph.php, line 77
Class
- ServiceReferenceGraph
- This is a directed graph of your services.
Namespace
Symfony\Component\DependencyInjection\CompilerCode
public function connect(?string $sourceId, mixed $sourceValue, ?string $destId, mixed $destValue = null, ?Reference $reference = null, bool $lazy = false, bool $weak = false, bool $byConstructor = false) : void {
if (null === $sourceId || null === $destId) {
return;
}
$sourceNode = $this->createNode($sourceId, $sourceValue);
$destNode = $this->createNode($destId, $destValue);
$edge = new ServiceReferenceGraphEdge($sourceNode, $destNode, $reference, $lazy, $weak, $byConstructor);
$sourceNode->addOutEdge($edge);
$destNode->addInEdge($edge);
}