Return new path with an added child.
@param string $key
@return NodePath
331756
public function addChild(string $key) : NodePath
    {
        $path = $this->path;
        $path[] = $key;
        return new NodePath($path);
    }
147979
public function key($key = null) {
		if($key === null) return $this->key;
		$this->key = $key;
		return $this;
	}
318930
private function computePath($key)
    {
        $directory = $this->getDirectory();
        if (null === $directory || '' === $directory) {
            return $key;
        }

        return sprintf('%s/%s', $directory, $key);
    }
706474
protected function getPath($key)
    {
        $parsed = $this->parseKey($key);

        array_shift($parsed);

        list ($dir, $file) = $parsed;
        return sprintf('%s/%s/%s', $this->path, $dir, $file);
    }
1203566
protected function constructKey(?string $key = null) : ?string
    {
        if (!is_null($key) && !is_null($this->current)) {
            return $this->current.'.'.$key;
        }

        if (is_null($key) && !is_null($this->current)) {
            return $this->current;
        }

        return $key;
    }
346559
public function getLastByKey($key)
    {
        if ($this->key == $key) return $this;

        return $this->children->getLastByKey($key);
    }
893700
public function setPath($key, $path)
	{
		$this->paths[(string) $key] = (string) $path;

		return $this;
	}
1117841
public function getKeyPath($key)
    {

        $key = str_replace('.', '/', trim($key, '.'));

        return implode('', [$this->_path, "/$key", $this->_format->getExtension()]);
    }
39862
public function parent($key):self
    {
        $breadcrumb = BreadcrumbFacade::get($key);
        $this->parents->put($key, $breadcrumb);

        return $this;
    }
700961
public function newMedioteca($key)
    {
        $nb_medioteca = new CNabuBuiltInMedioteca();
        $nb_medioteca->setKey($key);

        return $this->addMedioteca($nb_medioteca);
    }
392064
protected function getPath(/*# string */ $key)/*# : string */
    {
        // get directory first
        if (($pos = strrpos($key, '/')) !== false) {
            $dir  = $this->dir_root . DIRECTORY_SEPARATOR .
                    substr($key, 0, $pos) . DIRECTORY_SEPARATOR;
            $key  = substr($key, $pos + 1);
        } else {
            $dir  = $this->dir_root . DIRECTORY_SEPARATOR;
        }

        // get file path
        if (is_callable($this->path_func)) {
            $func = $this->path_func;
            $file = $func($key);

        // hashed version
        } else {
            $file = $key ? $this->hashIt($key) : '';
        }

        return $dir . $file;
    }
1316261
public function get($key)
    {
        if (mb_strpos($key, $this->delimiter) !== false) {
            return $this->getChild($key);
        }

        return parent::get($key);
    }
925064
protected function getPath($key)
    {
        $parts = explode('/', $key);
        $path = substr(parent::getPath(array_shift($parts)), 0, -4);
        foreach ($parts as $part) {
            $path .= DIRECTORY_SEPARATOR.$this->sanitizeReadableFileName($part);
        }
        return $path.'.conf.php';
    }
595182
protected function addPath($key, $path)
    {
        // Iterate through the extensions looking for files in the path
        foreach ($this->extensions as $extension) {
          // Find all matching files for this extension
          foreach (Finder::create()->files()->name("*.{$extension}")->in($path) as $file) {
            // Skip if the file belongs to a more specific extension
            if ($this->fileMatchesMoreSpecificExtension(basename($file->getRealPath()), $extension)) {
              continue;
            }

            // Work out the files key
            $key = $this->getNestedDirectoryDots($path, $file->getPath()).basename($file->getRealPath(), ".{$extension}");

            // We already have a matching file so we need to merge the config
            if (array_key_exists($key, $this->files)) {
              $this->files[$key][] = $file->getRealPath();
              $items = $this->mergeConfigs(app('config')->get($key), require $file->getRealPath());
            }
            // Otherwise we can just require the config in
            else {
              $this->files[$key] = [$file->getRealPath()];
              $items = require $file->getRealPath();
            }

            app('config')->set($key, $items);
          }
        }

        return parent::addPath($key, $path);
    }
876810
public function getKeyPath($key)
    {
        if (substr($key, 0, 1) !== '/') {
            $key = '/' . $key;
        }

        return rtrim('/' . $this->api_version . '/keys' . $this->root, '/') . $key;
    }
1101835
public function addTable(string $key) : TomlBuilder
    {
        $this->exceptionIfKeyEmpty($key);
        $addPreNewline = $this->currentLine > 0 ? true : false;
        $keyParts = explode('.', $key);

        foreach ($keyParts as $keyPart) {
            $this->exceptionIfKeyEmpty($keyPart, "Table: \"{$key}\".");
            $this->exceptionIfKeyIsNotUnquotedKey($keyPart);
        }

        $line = "[{$key}]";
        $this->addTableKey($key);
        $this->append($line, true, false, $addPreNewline);

        return $this;
    }
589444
private function getPath($bucketName = null, $key = null)
    {
        return HttpUtils::appendUri(self::BOS_URL_PREFIX, $bucketName, $key);
    }