JigsawGenerateRssFeedAfterBuild::handle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 10
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace PODEntender\Infrastructure\Application\StaticSite\FileProcessing;
4
5
use PODEntender\Application\Service\FileProcessing\GenerateRssFeed;
6
use PODEntender\Domain\Model\FileProcessing\RssFeedConfiguration;
7
use PODEntender\Infrastructure\Application\StaticSite\JigsawEventHandler;
8
use TightenCo\Jigsaw\Jigsaw;
9
10
class JigsawGenerateRssFeedAfterBuild implements JigsawEventHandler
11
{
12
    public function handle(Jigsaw $jigsaw): void
13
    {
14
        /** @var RssFeedConfiguration $configuration */
15
        $configuration = $jigsaw->app->get(RssFeedConfiguration::class);
16
17
        /** @var GenerateRssFeed $handler */
18
        $handler = $jigsaw->app->make(GenerateRssFeed::class);
19
20
        $outputXmlFile = $handler->execute($configuration);
21
        file_put_contents($outputXmlFile->path(), $outputXmlFile->content());
22
    }
23
}
24