Command   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 10
dl 0
loc 19
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A make() 0 16 2
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: thales
5
 * Date: 17/01/2019
6
 * Time: 19:47
7
 */
8
9
namespace Saci\Console\Infrastructure\Domain\Services\PhpClass;
10
11
12
use cristianoc72\codegen\model\GenerateableInterface;
13
use cristianoc72\codegen\model\PhpMethod;
14
use Saci\Console\Domain\Services\Exception\ClassNameIsNullException;
15
use Saci\Console\Domain\Services\PhpClass as PhpClassInterface;
16
17
class Command extends AbstractPhpClass implements PhpClassInterface
18
{
19
20 4
    public function make(): GenerateableInterface
21
    {
22 4
        $moduleName = $this->getModuleName();
23 4
        $className = $this->getClassName();
24
25 4
        if (!$className) {
26 1
            throw new ClassNameIsNullException('Não foi informado a nome para a Command. Utilize o método setClassName para innforma o nome da classe!');
27
        }
28
29
        $this
30 3
            ->setQualifiedName("Saci\\{$moduleName}\\UseCase\\{$className}")
31 3
            ->setMethod(
32 3
                PhpMethod::create('__construct')
33
            );
34
35 3
        return $this;
36
    }
37
}