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

GatewayBuilder   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getPathTemplate() 0 3 1
A getFileTemplate() 0 3 1
A __construct() 0 9 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\Gateway;
11
12
use FlexPHP\Generator\Domain\Builders\AbstractBuilder;
13
14
final class GatewayBuilder extends AbstractBuilder
15
{
16
    public function __construct(string $entity, array $actions)
17
    {
18
        $actions = \array_reduce($actions, function (array $result, string $action) {
19
            $result[] = $this->getCamelCase($action);
20
21
            return $result;
22
        }, []);
23
24
        parent::__construct(\compact('entity', 'actions'));
25
    }
26
27
    protected function getFileTemplate(): string
28
    {
29
        return 'Gateway.php.twig';
30
    }
31
32
    protected function getPathTemplate(): string
33
    {
34
        return \sprintf('%1$s/FlexPHP/Gateway', parent::getPathTemplate());
35
    }
36
}
37