AbstractGenerator::getTemplate()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 9
rs 10
1
<?php
2
/**
3
 * This file is part of graze/unicontroller-client.
4
 *
5
 * Copyright (c) 2016 Nature Delivered Ltd. <https://www.graze.com>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @license https://github.com/graze/unicontroller-client/blob/master/LICENSE.md
11
 * @link https://github.com/graze/unicontroller-client
12
 */
13
namespace Graze\UnicontrollerClient\ClassGenerator\Generator;
14
15
abstract class AbstractGenerator
16
{
17
    const PATH_TEMPLATE = '%s/Template/%s.php.tpl';
18
19
    /**
20
     * @param string $name
21
     * @return string
22
     */
23
    protected function getTemplate($name)
24
    {
25
        $path = sprintf(
26
            self::PATH_TEMPLATE,
27
            __DIR__,
28
            $name
29
        );
30
31
        return file_get_contents($path);
32
    }
33
}
34