alexecus/sitemaper

View on GitHub
src/Writer/FileWriter.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace Alexecus\Sitemaper\Writer;

use Symfony\Component\Filesystem\Filesystem;
use Alexecus\Sitemaper\Sitemap;

/**
 * Interface to define how sitemap output can be written
 *
 * @author Alex Tenepere <alex.tenepere@gmail.com>
 */
class FileWriter implements WriterInterface
{
    private $filesystem;

    public function __construct()
    {
        $this->filesystem = new Filesystem();
    }
    
    /**
     * {@inheritdoc}
     */
    public function write($file, $output)
    {
        $this->filesystem->dumpFile($file, $output);
    }
}