Failed Conditions
Push — master ( 28e23e...6697e2 )
by Yo
01:52
created

TemplateFileProcessor::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
namespace Yoanm\DefaultPhpRepository\Processor;
3
4
use Yoanm\DefaultPhpRepository\Helper\TemplateHelper;
5
6
/**
7
 * Class TemplateFileProcessor
8
 */
9
class TemplateFileProcessor
10
{
11
    /** @var TemplateHelper */
12
    private $helper;
13
14
    /**
15
     * TemplateFileProcessor constructor.
16
     * @param TemplateHelper $helper
17
     */
18
    public function __construct(TemplateHelper $helper)
19
    {
20
        $this->helper = $helper;
21
    }
22
23
    /**
24
     * @param string $templateFilePath
25
     * @param string $outputDir
26
     */
27
    public function process($templateFilePath, $outputDir = '.')
28
    {
29
        $this->getHelper()->dumpTemplate(
30
            $templateFilePath,
31
            $this->getHelper()->resolveOutputFilePath($templateFilePath, $outputDir)
32
        );
33
    }
34
35
    /**
36
     * @return TemplateHelper
37
     */
38
    protected function getHelper()
39
    {
40
        return $this->helper;
41
    }
42
}
43