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

AbstractCommand::modelNamespace()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
crap 2
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