protected function _processKey($config, $key, $value)
        {
            if (strpos($key, $this->_nestSeparator) !== false) {
                $parts = explode($this->_nestSeparator, $key, 2);
                if (strlen(Arrays::first($parts)) && strlen(Arrays::last($parts))) {
                    if (!isset($config[Arrays::first($parts)])) {
                        if (Arrays::first($parts) === '0' && !empty($config)) {
                            // convert the current values in $config into an array
                            $config = array(Arrays::first($parts) => $config);
                        } else {
                            $config[Arrays::first($parts)] = array();
                        }
                    } elseif (!Arrays::is($config[Arrays::first($parts)])) {
                        throw new Exception("Cannot create sub-key for '{Arrays::first($parts)}' as key already exists");
                    }
                    $config[Arrays::first($parts)] = $this->_processKey(
                        $config[Arrays::first($parts)],
                        Arrays::last($parts),
                        $value
                    );
                } else {
                    throw new Exception("Invalid key '$key'");
                }
            } else {
                $config[$key] = $value;
            }
            return $config;
        }
protected function _processKey($config, $key, $value)
        {
            if (strpos($key, $this->_nestSeparator) !== false) {
                $parts = explode($this->_nestSeparator, $key, 2);
                if (strlen(Arrays::first($parts)) && strlen(Arrays::last($parts))) {
                    if (!isset($config[Arrays::first($parts)])) {
                        if (Arrays::first($parts) === '0' && !empty($config)) {
                            // convert the current values in $config into an array
                            $config = array(Arrays::first($parts) => $config);
                        } else {
                            $config[Arrays::first($parts)] = array();
                        }
                    } elseif (!Arrays::is($config[Arrays::first($parts)])) {
                        throw new Exception("Cannot create sub-key for '{Arrays::first($parts)}' as key already exists");
                    }
                    $config[Arrays::first($parts)] = $this->_processKey(
                        $config[Arrays::first($parts)],
                        Arrays::last($parts),
                        $value
                    );
                } else {
                    throw new Exception("Invalid key '$key'");
                }
            } else {
                $config[$key] = $value;
            }
            return $config;
        }
protected function _processKey ( $ config , $ key , $ value ) { if ( strpos ( $ key , $ this -> _nestSeparator ) !== false ) { $ parts = explode ( $ this -> _nestSeparator , $ key , 2 ) ; if ( strlen ( Arrays :: first ( $ parts ) ) && strlen ( Arrays :: last ( $ parts ) ) ) { if ( ! isset ( $ config [ Arrays :: first ( $ parts ) ] ) ) { if ( Arrays :: first ( $ parts ) === '0' && ! empty ( $ config ) ) { // convert the current values in $config into an array $ config = array ( Arrays :: first ( $ parts ) => $ config ) ; } else { $ config [ Arrays :: first ( $ parts ) ] = array ( ) ; } } elseif ( ! Arrays :: is ( $ config [ Arrays :: first ( $ parts ) ] ) ) { throw new Exception ( "Cannot create sub-key for '{Arrays::first($parts)}' as key already exists" ) ; } $ config [ Arrays :: first ( $ parts ) ] = $ this -> _processKey ( $ config [ Arrays :: first ( $ parts ) ] , Arrays :: last ( $ parts ) , $ value ) ; } else { throw new Exception ( "Invalid key '$key'" ) ; } } else { $ config [ $ key ] = $ value ; } return $ config ; }
Assign the key's value to the property list. Handles the
nest separator for sub-properties.

@param  array  $config
@param  string $key
@param  string $value
@throws Exception
@return array
Assign the key s value to the property list . Handles the nest separator for sub - properties .