Passed
Push — master ( 99cab5...2782fc )
by Caen
04:06 queued 13s
created

GenerateSitemap::printFinishMessage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Hyde\Framework\Actions\PostBuildTasks;
6
7
use Hyde\Framework\Features\BuildTasks\PostBuildTask;
8
use Hyde\Framework\Features\XmlGenerators\SitemapGenerator;
9
use Hyde\Hyde;
10
11
class GenerateSitemap extends PostBuildTask
12
{
13
    public static string $message = 'Generating sitemap';
14
15
    public function handle(): void
16
    {
17
        file_put_contents(
18
            Hyde::sitePath('sitemap.xml'),
19
            SitemapGenerator::make()
20
        );
21
    }
22
23
    public function printFinishMessage(): void
24
    {
25
        $this->createdSiteFile('_site/sitemap.xml')->withExecutionTime();
26
    }
27
}
28