public function extract(string $namespace): Config
    {
        $extracted = $this->get($namespace);
        if (!is_array($extracted)) {
            throw ConfigException::forExtractionFailure($namespace);
        }

        return new self($extracted);
    }
public function extract(string $namespace): Config
    {
        $extracted = $this->get($namespace);
        if (!is_array($extracted)) {
            throw ConfigException::forExtractionFailure($namespace);
        }

        return new self($extracted);
    }
public function extract ( string $ namespace ) : Config { $ extracted = $ this -> get ( $ namespace ) ; if ( ! is_array ( $ extracted ) ) { throw ConfigException :: forExtractionFailure ( $ namespace ) ; } return new self ( $ extracted ) ; }
Returns new instance of the config containing only values from the
given namespace.

@param string $namespace
@return Config
Returns new instance of the config containing only values from the given namespace .