CommandClassMaker::generate()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

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