Completed
Push — master ( 6dd3a0...ec39b9 )
by Níckolas Daniel
05:32
created

GenerateRobotsTxtFile   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 4
dl 0
loc 12
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
namespace PODEntender\Application\Service\FileProcessing;
4
5
use PODEntender\Domain\Model\FileProcessing\OutputFile;
6
use PODEntender\Domain\Model\FileProcessing\RobotsTxt\RobotsTxtStringBuilder;
7
use PODEntender\Domain\Model\FileProcessing\RobotsTxt\RobotsTxt;
8
9
class GenerateRobotsTxtFile
10
{
11
    private $builder;
12
13 3
    public function __construct(RobotsTxtStringBuilder $builder)
14
    {
15 3
        $this->builder = $builder;
16 3
    }
17
18 3
    public function execute(RobotsTxt $robotsTxt, string $path) : OutputFile
19
    {
20 3
        return new OutputFile($path, $this->builder->build($robotsTxt));
21
    }
22
}
23