Test Setup Failed
Push — develop ( c73499...361b2b )
by Freddie
03:04
created

UseCaseBuilder   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 6
dl 0
loc 18
rs 10
c 2
b 0
f 0
ccs 4
cts 4
cp 1
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getFileTemplate() 0 3 1
A __construct() 0 6 1
A getPathTemplate() 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 7
 */
10
namespace FlexPHP\Generator\Domain\Builders\Controller;
11 7
12
use FlexPHP\Generator\Domain\Builders\AbstractBuilder;
13
14 7
final class UseCaseBuilder extends AbstractBuilder
15
{
16 7
    public function __construct(string $entity, string $action)
17
    {
18
        $entity = $this->getPascalCase($this->getSingularize($entity));
19 7
        $action = $this->getPascalCase($action);
20
21 7
        parent::__construct(\compact('entity', 'action'));
22
    }
23
24
    protected function getFileTemplate(): string
25
    {
26
        return 'UseCase.php.twig';
27
    }
28
29
    protected function getPathTemplate(): string
30
    {
31
        return \sprintf('%1$s/Symfony/v43/src/Controller', parent::getPathTemplate());
32
    }
33
}
34