private function fetchVariable($variable_name, $type)
    {
        $this->checkVariableExists($variable_name, $type);

        if ($type === 'env') {
            return getenv($variable_name);
        } elseif ($type === 'replacement') {
            return $this->rstore->get($variable_name);
        }

        return $this->vstore->get($variable_name);
    }