X-Git-Url: https://yaffs.net/gitweb/?a=blobdiff_plain;f=vendor%2Fsymfony%2Fdependency-injection%2FCompiler%2FCheckCircularReferencesPass.php;h=ac7866b2bab86a690e63840c228ba4b9007030e4;hb=4e1bfbf98b844da83b18aca92ef00f11a4735806;hp=f39a89af2be710018cf6d31c5633424934fd6fca;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/vendor/symfony/dependency-injection/Compiler/CheckCircularReferencesPass.php b/vendor/symfony/dependency-injection/Compiler/CheckCircularReferencesPass.php index f39a89af2..ac7866b2b 100644 --- a/vendor/symfony/dependency-injection/Compiler/CheckCircularReferencesPass.php +++ b/vendor/symfony/dependency-injection/Compiler/CheckCircularReferencesPass.php @@ -11,8 +11,8 @@ namespace Symfony\Component\DependencyInjection\Compiler; -use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException; use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException; /** * Checks your services for circular references. @@ -31,8 +31,6 @@ class CheckCircularReferencesPass implements CompilerPassInterface /** * Checks the ContainerBuilder object for circular references. - * - * @param ContainerBuilder $container The ContainerBuilder instances */ public function process(ContainerBuilder $container) { @@ -51,7 +49,7 @@ class CheckCircularReferencesPass implements CompilerPassInterface * * @param ServiceReferenceGraphEdge[] $edges An array of Edges * - * @throws ServiceCircularReferenceException When a circular reference is found. + * @throws ServiceCircularReferenceException when a circular reference is found */ private function checkOutEdges(array $edges) { @@ -60,13 +58,13 @@ class CheckCircularReferencesPass implements CompilerPassInterface $id = $node->getId(); if (empty($this->checkedNodes[$id])) { - // don't check circular dependencies for lazy services - if (!$node->getValue() || !$node->getValue()->isLazy()) { + // Don't check circular references for lazy edges + if (!$node->getValue() || (!$edge->isLazy() && !$edge->isWeak())) { $searchKey = array_search($id, $this->currentPath); $this->currentPath[] = $id; if (false !== $searchKey) { - throw new ServiceCircularReferenceException($id, array_slice($this->currentPath, $searchKey)); + throw new ServiceCircularReferenceException($id, \array_slice($this->currentPath, $searchKey)); } $this->checkOutEdges($node->getOutEdges());