VariationsTreeBuilder.php
private function detectCircular(array $variations, AbstractVariation $variation, array $path)
    {
        foreach ($variations as $item) {
            if ($item->dependsOn($variation->getName())) {
                if ($item === $variation
                    || $variation->dependsOn($item->getName())
                    || in_array($item->getName(), $path, true)) {
                    $path[] = $item->getName();
                    throw Helper::fromPath(implode('.', $path));
                }
                $this->detectCircular($variations, $item, $path);
            }
        }

        return false;
    }
private function detectCircular(array $variations, AbstractVariation $variation, array $path)
    {
        foreach ($variations as $item) {
            if ($item->dependsOn($variation->getName())) {
                if ($item === $variation
                    || $variation->dependsOn($item->getName())
                    || in_array($item->getName(), $path, true)) {
                    $path[] = $item->getName();
                    throw Helper::fromPath(implode('.', $path));
                }
                $this->detectCircular($variations, $item, $path);
            }
        }

        return false;
    }
@param array             $variations
@param AbstractVariation $variation
@param array             $path

@return bool

@throws Exception\CircularDependencyException