protected function traverseTree($path)
    {
        // before the travel current node is the root
        $currentNode = $this->tree;

        $pathElements = explode(static::KEY_NODE_DELIMITER, $path);
        foreach($pathElements as $node)
        {
            // Ensure the next child exists
            if(!isset($currentNode[$node]))
            {
                throw new MissingKeyException("{$path} configuration value is not found");
            }

            //update the current path if the child existed
            $currentNode = $currentNode[$node];
        }

        return $currentNode;
    }
protected function traverseTree($path)
    {
        // before the travel current node is the root
        $currentNode = $this->tree;

        $pathElements = explode(static::KEY_NODE_DELIMITER, $path);
        foreach($pathElements as $node)
        {
            // Ensure the next child exists
            if(!isset($currentNode[$node]))
            {
                throw new MissingKeyException("{$path} configuration value is not found");
            }

            //update the current path if the child existed
            $currentNode = $currentNode[$node];
        }

        return $currentNode;
    }
protected function traverseTree ( $ path ) { // before the travel current node is the root $ currentNode = $ this -> tree ; $ pathElements = explode ( static :: KEY_NODE_DELIMITER , $ path ) ; foreach ( $ pathElements as $ node ) { // Ensure the next child exists if ( ! isset ( $ currentNode [ $ node ] ) ) { throw new MissingKeyException ( "{$path} configuration value is not found" ) ; } //update the current path if the child existed $ currentNode = $ currentNode [ $ node ] ; } return $ currentNode ; }
Traverse a tree until the end of path is reached

$path can be separated with a dot .

In an array [ "section" => ["a => "b"], ["b" => "B"]

value B can be accessed by giving section.b key

@param string $path The path

@throws MissingKeyException if the path is unreachable

@return string
Traverse a tree until the end of path is reached