VariationsTreeBuilder.php
private function detectCircularDependencies(array $variations)
    {
        $tree = [];

        foreach ($variations as $variation) {
            $tree[$variation->getName()] = $this->detectCircular($variations, $variation, [$variation->getName()]);
        }

        return $tree;
    }
private function detectCircularDependencies(array $variations)
    {
        $tree = [];

        foreach ($variations as $variation) {
            $tree[$variation->getName()] = $this->detectCircular($variations, $variation, [$variation->getName()]);
        }

        return $tree;
    }
@param array $variations

@return array

@throws Exception\CircularDependencyException