protected function doGetInjectedDefinitions($name, array &$visited)
    {
        if (isset($visited[$name])) {
            return;
        }

        try {
            $visited[$name] = $this->proxy->get($name);
        } catch (RuntimeException $e) {
            // usually abstract class or interface that cannot be resolved
            return;
        } catch (MissingPropertyException $e) {
            // usually missing parameters required for a particular instance
            return;
        }

        foreach ($visited[$name]->getParams() as $param) {
            if ($param instanceof GeneratorInstance) {
                /* @var $param GeneratorInstance */
                $this->doGetInjectedDefinitions($param->getName(), $visited);
            }
        }

        foreach ($visited[$name]->getMethods() as $method) {
            if (isset($method['params']) && is_array($method['params'])) {
                foreach ($method['params'] as $param) {
                    /* @var $param GeneratorInstance */
                    if ($param instanceof GeneratorInstance) {
                        /* @var $param GeneratorInstance */
                        $this->doGetInjectedDefinitions($param->getName(), $visited);
                    }
                }
            }
        }
    }