Test Failed
Push — master ( 2fa9b0...1565e2 )
by
unknown
01:50
created

CommandClassMaker   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 7
dl 0
loc 19
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
    public function __construct(Command $command)
25
    {
26
        $this->command = $command;
27
    }
28
29
    public function generate(PhpClass $phpClass): GenerateableInterface
30
    {
31
        return $phpClass
32
            ->setModuleName($this->command->getModule()->getName())
33
            ->setClassName($this->command->getClassNameCommand())
34
            ->make();
35
    }
36
}