Ding\Container\Impl\ContainerImpl::_getValueFromDefinition PHP Method

_getValueFromDefinition() private method

This will resolve a property (or constructor arg) definition to a final value, being a bean reference, array of other properties (or constructor args), etc.
private _getValueFromDefinition ( Ding\Bean\BeanPropertyDefinition | Ding\Bean\BeanConstructorArgumentDefinition $what ) : void
$what Ding\Bean\BeanPropertyDefinition | Ding\Bean\BeanConstructorArgumentDefinition
return void
    private function _getValueFromDefinition($what)
    {
        $value = null;
        if ($what->isBean()) {
            $value = $this->getBean($what->getValue());
        } else {
            if ($what->isArray()) {
                $value = array();
                foreach ($what->getValue() as $k => $v) {
                    $value[$k] = $this->_getValueFromDefinition($v);
                }
            } else {
                if ($what->isCode()) {
                    $value = eval($what->getValue());
                } else {
                    $value = $this->_loadValue($what->getValue());
                }
            }
        }
        return $value;
    }