Test Failed
Push — master ( 1565e2...1c0683 )
by
unknown
03:24
created

CommandHandlerClassMaker::generate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: thales
5
 * Date: 22/01/2019
6
 * Time: 10:28
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 CommandHandlerClassMaker implements \Saci\Console\Domain\Services\ClassMaker
17
{
18
    /**
19
     * @var Command
20
     */
21
    private $command;
22
23
    public function __construct(Command $command)
24
    {
25
        $this->command = $command;
26
    }
27
28
    public function generate(PhpClass $phpClass): GenerateableInterface
29
    {
30
        return $phpClass
31
            ->setModuleName($this->command->getModule()->getName())
32
            ->setClassName($this->command->getClassNameCommandHandler())
33
            ->make();
34
    }
35
}