Test Setup Failed
Push — develop ( 17b215...d74e9d )
by Freddie
13:13
created

UseCaseBuilder   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getFileTemplate() 0 3 1
A __construct() 0 5 1
A build() 0 3 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
20
        parent::__construct(\compact('entity', 'action'));
21 7
    }
22
23
    public function build(): string
24
    {
25
        return \rtrim(parent::build());
26
    }
27
28
    protected function getFileTemplate(): string
29
    {
30
        return 'UseCase.php.twig';
31
    }
32
33
    protected function getPathTemplate(): string
34
    {
35
        return \sprintf('%1$s/Symfony/v43/src/Controller', parent::getPathTemplate());
36
    }
37
}
38