src/AbstractConfig.php
public function get(string ...$path)
    {
        if (count($path) === 1) {
            if (!$this->offsetExists($path[0])) {
                throw ConfigKeyNotFoundException::fromPath($path);
            }

            return $this->offsetGet($path[0]);
        }

        $keys = array_reverse($path);
        $arr  = $this->getArrayCopy();
        while (count($keys) > 0) {
            $key = array_pop($keys);
            if (!isset($arr[$key])) {
                throw ConfigKeyNotFoundException::fromPath($path);
            }

            $arr = $arr[$key];
        }

        return $arr;
    }
public function get(string ...$path)
    {
        if (count($path) === 1) {
            if (!$this->offsetExists($path[0])) {
                throw ConfigKeyNotFoundException::fromPath($path);
            }

            return $this->offsetGet($path[0]);
        }

        $keys = array_reverse($path);
        $arr  = $this->getArrayCopy();
        while (count($keys) > 0) {
            $key = array_pop($keys);
            if (!isset($arr[$key])) {
                throw ConfigKeyNotFoundException::fromPath($path);
            }

            $arr = $arr[$key];
        }

        return $arr;
    }
public function get ( string ... $ path ) { if ( count ( $ path ) === 1 ) { if ( ! $ this -> offsetExists ( $ path [ 0 ] ) ) { throw ConfigKeyNotFoundException :: fromPath ( $ path ) ; } return $ this -> offsetGet ( $ path [ 0 ] ) ; } $ keys = array_reverse ( $ path ) ; $ arr = $ this -> getArrayCopy ( ) ; while ( count ( $ keys ) > 0 ) { $ key = array_pop ( $ keys ) ; if ( ! isset ( $ arr [ $ key ] ) ) { throw ConfigKeyNotFoundException :: fromPath ( $ path ) ; } $ arr = $ arr [ $ key ] ; } return $ arr ; }
Get the value for a specific key.

@since 1.0.0

@param string ...$path Key, or path segments if key is nested.

@return mixed Value for the key.

@throws ConfigKeyNotFoundException Thrown if the key does not exist.
Get the value for a specific key .