Dump recursive with dot syntax any PHP object/array data into INI syntax.
@param string $levelKey
@param mixed  $data
@param mixed  $rawData
@return void
490421
protected function dumpRecursive ($levelKey, & $data, & $rawData) {
		if (is_object($data) || is_array($data)) {
			if (strlen($levelKey) > 0) $levelKey .= '.';
			foreach ((array) $data as $key => & $value) {
				$this->dumpRecursive($levelKey . $key, $value, $rawData);
			}
		} else {
			$rawData[] = $levelKey . ' = ' . $this->dumpScalarValue($data);
		}
	}
529708
protected function _parseThreadLevel(&$thread,
                                         Horde_Imap_Client_Tokenize $data,
                                         $level = 0)
    {
        while (($curr = $data->next()) !== false) {
            if ($curr === true) {
                $this->_parseThreadLevel($thread, $data, $level);
            } elseif (!is_bool($curr)) {
                $thread[$curr] = $level++;
            }
        }
    }
854170
public static function recursiveData2XML($data, string $item = 'item', string $id = 'id'): string {
		$xml = $attr = '';
		if (is_array($data)) {
			foreach ($data as $key => $val) {
				if (is_numeric($key)) {
					$id && $attr = " {$id}=\"{$key}\"";
					$key = $item;
				}
				$xml .= "<{$key}{$attr}>";
				$xml .= (is_array($val) || is_object($val)) ? static::recursiveData2XML($val, $item, $id) : $val;
				$xml .= "</{$key}>";
			}
		}
		elseif (is_string($data))
			return $data;
		else throw new EncodeXMLException;
		return $xml;
	}
1002871
public function fillObjectWithRawData($targetObject, $rawData)
	{
		$classDefinition = $this->classDefinitionBuilder->buildFromClass(get_class($targetObject));

		$this->processObject($classDefinition, $targetObject, $rawData);
	}
410025
public function setMetadata($key, $data = null)
    {
        if (is_null($data)) {
            unset($this->_metadata[$key]);
        } else {
            $this->_metadata[$key] = $data;
        }
    }
1143154
protected static function arrayToXmlInternal($data, $root = null, $level = 1, $format = true)
    {
        $xml = null;
        if (is_array($data)) {
            if (!Arr::isAssoc($data)) {
                foreach ($data as $value) {
                    $xml .= self::arrayToXmlInternal($value, $root, $level, $format);
                }
            } else {
                if (Arr::isAssoc($data)) {
                    if (!empty($root)) {
                        if ($format) {
                            $xml .= str_repeat("\t", $level - 1);
                        }
                        $xml .= "<$root>";
                        if ($format) {
                            $xml .= "\n";
                        }
                    }
                    foreach ($data as $key => $value) {
                        $xml .= self::arrayToXmlInternal($value, $key, $level + 1, $format);
                    }
                    if (!empty($root)) {
                        if ($format) {
                            $xml .= str_repeat("\t", $level - 1);
                        }
                        $xml .= "</$root>";
                        if ($format) {
                            $xml .= "\n";
                        }
                    }
                } else {
                    // empty array
                    if (!empty($root)) {
                        if ($format) {
                            $xml .= str_repeat("\t", $level - 1);
                        }
                        $xml .= "<$root></$root>";
                        if ($format) {
                            $xml .= "\n";
                        }
                    }
                }
            }
        } elseif (is_object($data)) {
            if ($data instanceof Arrayable) {
                $xml .= self::arrayToXmlInternal($data->toArray(), $root, $level, $format);
            } else {
                $dataString = (string)$data;
                if (!empty($root)) {
                    if ($format) {
                        $xml .= str_repeat("\t", $level - 1);
                    }
                    $xml .= "<$root>$dataString</$root>";
                    if ($format) {
                        $xml .= "\n";
                    }
                }
            }
        } else {
            // not an array or object
            if (!empty($root)) {
                if ($format) {
                    $xml .= str_repeat("\t", $level - 1);
                }
                $xml .= "<$root>";
                if (!is_null($data)) {
                    if (is_bool($data)) {
                        $xml .= ($data) ? 'true' : 'false';
                    } else {
                        if (is_int($data) || is_float($data)) {
                            $xml .= $data;
                        } else {
                            if (is_string($data)) {
                                $htmlValue = htmlspecialchars($data, ENT_QUOTES, 'UTF-8');
                                $xml .= $htmlValue;
                            }
                        }
                    }
                }
                $xml .= "</$root>";
                if ($format) {
                    $xml .= "\n";
                }
            }
        }

        return $xml;
    }
786970
public function render($key, array $items = [], array $options = [], $level = 1)
    {
        $i = 0;
        $output    = [];
        $options   = Hash::merge($this->_default, $options);
        $sorted    = Hash::sort($items, '{s}.weight', 'ASC');
        $itemCount = count($sorted);

        foreach ($sorted as $item) {
            $i++;
            $item = $this->_setFirstLast($i, $itemCount, $item);

            $children = false;
            if (count($item['children']) > 0) {
                $children = $this->render($key, $item['children'], $options, $level + 1);
            }

            $itemParams = [
                'options'  => $options,
                'item'     => $item,
                'count'    => $i,
                'children' => $children,
                'level'    => $level,
            ];

            $this->_setItemParams($itemParams);

            if (isset($item['callable']) && is_callable($item['callable'])) {
                $output[] = call_user_func_array($item['callable'], array_merge(['view' => $this->_View], $itemParams));
            } else {
                $output[] = $this->_View->element($options['itemElement'], $itemParams);
            }
        }

        $element = $this->_getCurrentMenuElement($options, $level);

        return $this->_View->element($element, [
            'content' => $output,
            'options' => $options,
        ]);
    }
36710
public function setData($data, $key = null)
	{
		if (is_array($data) && $key === null) {
			$this->data = $data;

			return $this;
		}

		if ($key === null)
			$key = 'data';

		$this->data[$key] = $data;

		return $this;
	}
49821
public static function makeFirstLevelArray($multilevelData)
    {
        $it = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($multilevelData));
        $keyValueArr = [];
        foreach ($it as $k => $v) {

            $decoded = json_decode($v);
            if (!$decoded || is_int($decoded)) {
                throw new JsonException('Not json.');
            }

            if (is_array($decoded) || is_object($decoded)) {
                $nestedIt = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($decoded));
                foreach ($nestedIt as $nK => $nV) {
                    $keyValueArr[$nK] = $nV;
                }

                continue;
            }

            $keyValueArr[$k] = $v;
        }

        return $keyValueArr;
    }
841583
private static function recursiveKeyExist($data, $key)
    {
        if (empty($key)) {
            return true;
        } else {
            $currentKey = array_shift($key);
            return isset($data[$currentKey]) ? self::recursiveKeyExist($data[$currentKey], $key) : false;
        }
    }
751604
public function fillRawData(string $rawData): TelegramResponse
    {
        $this->rawData = $rawData;
        $this->decodedData = json_decode($this->rawData, true);

        if ($this->decodedData['ok'] === false) {
            $exception = new ClientException();
            $exception->setError(new UnsuccessfulRequest($this->decodedData));
            throw $exception;
        }

        return $this;
    }
898794
protected function build( array $data, $depth = 0, $prevKey = null ) {
		$valueOutput = "";
		$arrayOutput = "";

		if( $depth > 2 ) {
			throw new ExceededMaxDepthException("Max INI Depth of 2 Exceeded");
		}

		$position = 0;
		foreach( $data as $key => $val ) {
			if( $this->skipNullValues && $val === null ) {
				continue;
			} elseif( is_array($val) ) {
				if( $depth == 0 ) {
					$arrayOutput .= "\n[{$key}]\n";
				}
				$arrayOutput .= $this->build($val, $depth + 1, $key);
			} else {
				$valStr = $this->escape($val);
				if( $depth > 1 ) {

					if( $key !== $position ) {
						if( ctype_digit((string)$key) ) {
							$position = $key;
						}

						$valueOutput .= "{$prevKey}[{$key}] = {$valStr}\n";
					} else {
						$valueOutput .= "{$prevKey}[] = {$valStr}\n";
					}

					$position++;
				} else {
					$valueOutput .= "{$key} = {$valStr}\n";
				}
			}
		}

		$output = "{$valueOutput}\n{$arrayOutput}";

		return $depth ? ltrim($output) : trim($output);
	}
1068117
public function setData($data, $key = '', $merge = false)
    {
        if ($key) {
            if ($merge && !empty($this->data[$key])) {
                $this->data[$key] = array_merge($this->data[$key], (array) $data);
            } else {
                $this->data[$key] = $data;
            }
        } else {
            if (is_object($data)) {
                $data = get_object_vars($data);
            }
            if (is_array($data)) {
                $this->data = array_merge($this->data, $data);
            }
        }
    }
659210
final protected function set_data($data, $key = ''){
        if( empty($key) ){
            if( is_array($data) ){
                $this->data = array_merge($this->data, $data);
            }
        }else{
            $this->data[$key] = $data;
        }
    }
1344362
protected function saveSubAttributeById($id, $subKey, $subData)
    {
        $subId = $this->getSubAttributeId($id, $subKey);
        $this->getSubAttributeFileRequest($subKey)
            ->putContents($this->key, $subId, $subData);
    }
215698
protected function parseData($rawData)
    {
        $outputData = [];

        foreach (explode(' ', $rawData) as $data) {
            $data = explode(':', $data);
            $outputData[$data[0]] = $data[1];
        }

        return $outputData;
    }
112934
public function close($data = null, $raw = false)
    {
        if ($this->_status === self::STATUS_CLOSING || $this->_status === self::STATUS_CLOSED) {
            return;
        } else {
            if ($data !== null) {
                $this->send($data, $raw);
            }
            $this->_status = self::STATUS_CLOSING;
        }
        if ($this->_sendBuffer === '') {
            $this->destroy();
        }
    }