protected function checkCircularReferences($name, \Closure $definition)
    {
        $arguments  = $this->getServiceArgumentNames($definition);

        if (in_array($name, $arguments, true)) {
            throw new \InvalidArgumentException('Circular exception detected');
        }
    }