Completed
Push — master ( 44f310...207ea5 )
by Torsten
03:42
created

AbstractCommand   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 3
dl 0
loc 33
ccs 0
cts 14
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A modelPath() 0 4 1
A modelNamespace() 0 4 1
A twig() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Lej\Command;
6
7
use Symfony\Component\Console\Command\Command;
8
9
abstract class AbstractCommand extends Command
10
{
11
    /**
12
     * @param string $domain
13
     * @param string $context
14
     * @return string
15
     */
16
    protected function modelPath(string $domain, string $context) : string
17
    {
18
        return sprintf('src/%s/%s/Domain/Model', $domain, $context);
19
    }
20
21
    /**
22
     * @param string $domain
23
     * @param string $context
24
     * @return string
25
     */
26
    protected function modelNamespace(string $domain, string $context) : string
27
    {
28
        return sprintf('%s\%s\Domain\Model', $domain, $context);
29
    }
30
31
    /**
32
     * @return \Twig_Environment
33
     */
34
    protected function twig() : \Twig_Environment
35
    {
36
        $loader = new \Twig_Loader_Filesystem(__DIR__ . '/../Resources/Template');
37
        $twig = new \Twig_Environment($loader);
38
39
        return $twig;
40
    }
41
}
42