public function setValueByPath($path, $value)
    {
        if (is_string($path)) {
            $path = $this->parsePath($path);
        }

        $endPart = array_pop($path);
        $child = & $this->data;

        foreach ($path as $part) {
            if (isset($child[$part])) {
                $child = & $child[$part];
            } else {
                $child[$part] = [];
                $child = & $child[$part];
            }
        }

        $child[$endPart] = $value;
    }