<NME> HtmlExporter.php
<BEF> <?php
namespace Fireguard\Report\Exporters;

use Fireguard\Report\Contracts\ExporterInterface;
use Fireguard\Report\Contracts\ReportInterface;

class HtmlExporter extends AbstractExporter implements ExporterInterface
{

    public function configure(array $config = [])
    {
        $this->extension = '.html';
        $defaultConfig = $this->getDefaultConfiguration();
        $this->config = array_replace_recursive($defaultConfig['html'] , $config);
    }

    public function generate(ReportContract $report)
    {
        $html = '<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>'.$this->fileName.'</title></head>';
        $html.= '<body style="background-color: #ffffff;">';
        $html.= $this->getProcessedHeader($report).$report->getContent().$this->getProcessedFooter($report);
        $html.= '</body></html>';
        return $this->saveFile($html);
    }

    /**
     * @return string
     */
    public function getMimeType()
    {
        return 'text/html';
    }

    public function getProcessedHeader(ReportInterface $report)
    {
        return $this->processInlineHtml($report->getHeader());
    }

    public function getProcessedFooter(ReportInterface $report)
    {
        return $this->processInlineHtml($report->getFooter());
    }

    public function saveFile($content)
    {
        file_put_contents($this->getFullPath(), $content);
        return $this->getFullPath();
    }

    protected function processInlineHtml($html)
    {
        $clearHtml = str_replace('"', '\'', $html);
        $clearHtml = str_replace("@{{", '', $clearHtml);
        $clearHtml = str_replace("{{", '', $clearHtml);
        $clearHtml = str_replace('numPage', ' 1 ', $clearHtml);
        $clearHtml = str_replace('totalPages', ' 1 ', $clearHtml);
        return $this->compress(str_replace("}}", '', $clearHtml));
    }
}

<MSG> Correction for exporter interface tests

<DFF> @@ -12,6 +12,7 @@ class HtmlExporter extends Exporter implements ExporterContract
         $this->extension = '.html';
         $defaultConfig = $this->getDefaultConfiguration();
         $this->config = array_replace_recursive($defaultConfig['html'] , $config);
+        return $this;
     }
 
     public function generate(ReportContract $report)

{'addition_count': 1, 'commit_subject': 'Correction for exporter interface tests', 'deletion_count': 0, 'file_extension': '.php', 'lang': 'php', 'license': 'mit', 'repo_name': 'fireguard/report'}