Completed
Push — develop ( 8dd5aa...fee724 )
by Freddie
14:52
created

FkGetterBuilder   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 20
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getPathTemplate() 0 3 1
A __construct() 0 8 1
A getFileTemplate() 0 3 1
1
<?php declare(strict_types=1);
2
/*
3
 * This file is part of FlexPHP.
4
 *
5
 * (c) Freddie Gar <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace FlexPHP\Generator\Domain\Builders\Entity;
11
12
use FlexPHP\Generator\Domain\Builders\AbstractBuilder;
13
14
final class FkGetterBuilder extends AbstractBuilder
15
{
16
    public function __construct(string $name, string $type)
17
    {
18
        $name = $this->getInflector()->camelProperty($name);
19
        $getter = $this->getInflector()->camelProperty($name);
20
        $type = $this->getInflector()->entity($type);
21
        $typeName = $this->getInflector()->camelProperty($type);
22
23
        parent::__construct(\compact('name', 'getter', 'type', 'typeName'));
24
    }
25
26
    protected function getFileTemplate(): string
27
    {
28
        return 'FkGetter.php.twig';
29
    }
30
31
    protected function getPathTemplate(): string
32
    {
33
        return \sprintf('%1$s/FlexPHP/Entity', parent::getPathTemplate());
34
    }
35
}
36