CommandClassMaker   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 7
dl 0
loc 19
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A generate() 0 6 1
A __construct() 0 3 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: thales
5
 * Date: 19/01/2019
6
 * Time: 14:04
7
 */
8
9
namespace Saci\Console\Infrastructure\Domain\Services;
10
11
12
use cristianoc72\codegen\model\GenerateableInterface;
13
use Saci\Console\Domain\Entity\Command;
14
use Saci\Console\Domain\Services\PhpClass;
15
16
class CommandClassMaker implements \Saci\Console\Domain\Services\ClassMaker
17
{
18
19
    /**
20
     * @var Command
21
     */
22
    private $command;
23
24 2
    public function __construct(Command $command)
25
    {
26 2
        $this->command = $command;
27 2
    }
28
29 2
    public function generate(PhpClass $phpClass): GenerateableInterface
30
    {
31
        return $phpClass
32 2
            ->setModuleName($this->command->getModule()->getName())
33 2
            ->setClassName($this->command->getClassNameCommand())
34 2
            ->make();
35
    }
36
}