FkUseCaseBuilder::getFileTemplate()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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\UseCase;
11
12
use FlexPHP\Generator\Domain\Builders\AbstractBuilder;
13
14
final class FkUseCaseBuilder extends AbstractBuilder
15
{
16
    public function __construct(string $pkEntity, string $fkEntity)
17
    {
18
        $name = $this->getInflector()->fnPlural($fkEntity);
19
        $pkItem = $this->getInflector()->item($pkEntity);
20
        $fkItems = $this->getInflector()->items($fkEntity);
21
        $pkEntity = $this->getInflector()->entity($pkEntity);
22
        $fkEntity = $this->getInflector()->entity($fkEntity);
23
        $header = self::getHeaderFile();
24
25
        parent::__construct(\compact('header', 'pkEntity', 'fkEntity', 'name', 'pkItem', 'fkItems'));
26
    }
27
28
    protected function getFileTemplate(): string
29
    {
30
        return 'FkUseCase.php.twig';
31
    }
32
33
    protected function getPathTemplate(): string
34
    {
35
        return \sprintf('%1$s/FlexPHP/UseCase', parent::getPathTemplate());
36
    }
37
}
38