src/OcraDiCompiler/Dumper.php
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);
                    }
                }
            }
        }
    }
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);
                    }
                }
            }
        }
    }
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 ) ; } } } } }
Recursively looks for discovered dependencies

@param string $name of the instances to get
@param array  $visited the array where discovered instance definitions will be stored
Recursively looks for discovered dependencies