protected function renderTemplate($templateName, array $variables = [])
    {
        $templatePath = __DIR__ . '/../../../stub/' . $templateName;
        if (!file_exists($templatePath)) {
            throw new DbExporterException('Template ' . $templateName . ' not found');
        }

        $template = file_get_contents($templatePath);

        $search  = array_keys($variables);
        $replace = array_values($variables);

        foreach ($search as &$item) {
            $item = '{{' . $item . '}}';
        }

        return str_replace($search, $replace, $template);
    }