Passed
Push — ft/sitemap ( 686bce...8c914b )
by Ben
07:09
created

SitemapXmlFile::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Thinktomorrow\Chief\System\Sitemap;
5
6
class SitemapXmlFile
7
{
8
    /** @var SitemapXml */
9
    private $sitemapXml;
10
11
    public function __construct(SitemapXml $sitemapXml)
12
    {
13
        $this->sitemapXml = $sitemapXml;
14
    }
15
16
    public function create(string $locale, string $filepath): void
17
    {
18
        $xmlString = $this->sitemapXml->generate($locale);
19
trap($xmlString);
20
        file_put_contents($filepath, $xmlString);
21
    }
22
}
23