src/mg/Ding/Bean/Provider/Yaml.php
private function _loadConstructorArg($name, $value, $yamlFilename)
    {
        if (is_array($value)) {
            if (isset($value['ref'])) {
                $argType = BeanConstructorArgumentDefinition::BEAN_CONSTRUCTOR_BEAN;
                $argValue = $value['ref'];
            } else if (isset($value['eval'])) {
                $argType = BeanConstructorArgumentDefinition::BEAN_CONSTRUCTOR_CODE;
                $argValue = $value['eval'];
            } else if (isset($value['bean'])) {
                $argType = BeanConstructorArgumentDefinition::BEAN_CONSTRUCTOR_BEAN;
                $innerBean = BeanDefinition::generateName('Bean');
                $this->_yamlFiles[$yamlFilename]['beans'][$innerBean] = $value['bean'];
                $argValue = $innerBean;
            } else {
                $argType = BeanConstructorArgumentDefinition::BEAN_CONSTRUCTOR_ARRAY;
                $argValue = array();
                foreach ($value as $key => $inValue) {
                    $argValue[$key] = $this->_loadConstructorArg(false, $inValue, $yamlFilename);
                }
            }
        } else {
            $argType = BeanConstructorArgumentDefinition::BEAN_CONSTRUCTOR_VALUE;
            $argValue = $value;
        }
        if (is_string($name)) {
            $argName = $name;
        } else {
            $argName = false;
        }
        return new BeanConstructorArgumentDefinition($argType, $argValue, $argName);
    }
private function _loadConstructorArg($name, $value, $yamlFilename)
    {
        if (is_array($value)) {
            if (isset($value['ref'])) {
                $argType = BeanConstructorArgumentDefinition::BEAN_CONSTRUCTOR_BEAN;
                $argValue = $value['ref'];
            } else if (isset($value['eval'])) {
                $argType = BeanConstructorArgumentDefinition::BEAN_CONSTRUCTOR_CODE;
                $argValue = $value['eval'];
            } else if (isset($value['bean'])) {
                $argType = BeanConstructorArgumentDefinition::BEAN_CONSTRUCTOR_BEAN;
                $innerBean = BeanDefinition::generateName('Bean');
                $this->_yamlFiles[$yamlFilename]['beans'][$innerBean] = $value['bean'];
                $argValue = $innerBean;
            } else {
                $argType = BeanConstructorArgumentDefinition::BEAN_CONSTRUCTOR_ARRAY;
                $argValue = array();
                foreach ($value as $key => $inValue) {
                    $argValue[$key] = $this->_loadConstructorArg(false, $inValue, $yamlFilename);
                }
            }
        } else {
            $argType = BeanConstructorArgumentDefinition::BEAN_CONSTRUCTOR_VALUE;
            $argValue = $value;
        }
        if (is_string($name)) {
            $argName = $name;
        } else {
            $argName = false;
        }
        return new BeanConstructorArgumentDefinition($argType, $argValue, $argName);
    }
Returns a constructor argument definition.

@param mixed  $value Constructor arg YAML structure value.
@param string $yamlFilename Filename for yaml file.

@throws BeanFactoryException
@return BeanConstructorArgumentDefinition