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

TemplateFileProcessor   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 34
ccs 0
cts 15
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A process() 0 7 1
A getHelper() 0 4 1
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