X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fsymfony%2Fdependency-injection%2FCompiler%2FServiceReferenceGraph.php;fp=vendor%2Fsymfony%2Fdependency-injection%2FCompiler%2FServiceReferenceGraph.php;h=d040e66c4dac757777ff0bc6eea663d7ea4fca65;hp=e7306ab560e2204a4a7718ecc8c38a2d3adb07bc;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/symfony/dependency-injection/Compiler/ServiceReferenceGraph.php b/vendor/symfony/dependency-injection/Compiler/ServiceReferenceGraph.php index e7306ab56..d040e66c4 100644 --- a/vendor/symfony/dependency-injection/Compiler/ServiceReferenceGraph.php +++ b/vendor/symfony/dependency-injection/Compiler/ServiceReferenceGraph.php @@ -20,6 +20,8 @@ use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; * it themselves which improves performance quite a lot. * * @author Johannes M. Schmitt + * + * @final since version 3.4 */ class ServiceReferenceGraph { @@ -73,6 +75,9 @@ class ServiceReferenceGraph */ public function clear() { + foreach ($this->nodes as $node) { + $node->clear(); + } $this->nodes = array(); } @@ -80,16 +85,25 @@ class ServiceReferenceGraph * Connects 2 nodes together in the Graph. * * @param string $sourceId - * @param string $sourceValue + * @param mixed $sourceValue * @param string $destId - * @param string $destValue + * @param mixed $destValue * @param string $reference + * @param bool $lazy + * @param bool $weak */ - public function connect($sourceId, $sourceValue, $destId, $destValue = null, $reference = null) + public function connect($sourceId, $sourceValue, $destId, $destValue = null, $reference = null/*, bool $lazy = false, bool $weak = false*/) { + $lazy = func_num_args() >= 6 ? func_get_arg(5) : false; + $weak = func_num_args() >= 7 ? func_get_arg(6) : false; + + if (null === $sourceId || null === $destId) { + return; + } + $sourceNode = $this->createNode($sourceId, $sourceValue); $destNode = $this->createNode($destId, $destValue); - $edge = new ServiceReferenceGraphEdge($sourceNode, $destNode, $reference); + $edge = new ServiceReferenceGraphEdge($sourceNode, $destNode, $reference, $lazy, $weak); $sourceNode->addOutEdge($edge); $destNode->addInEdge($edge); @@ -99,7 +113,7 @@ class ServiceReferenceGraph * Creates a graph node. * * @param string $id - * @param string $value + * @param mixed $value * * @return ServiceReferenceGraphNode */