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

GatewayBuilder::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 9
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\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