Test Failed
Push — master ( cf589e...4e3804 )
by Grupo
02:17
created

ModuleMaker::make()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 1
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: thales
5
 * Date: 24/11/2018
6
 * Time: 22:41
7
 */
8
9
namespace Saci\Console\Infrastructure\Domain\Services;
10
11
12
use Saci\Console\Domain\Entity\Module;
13
use Saci\Console\Domain\Exceptions\ModuleAlreadyExists;
14
use Symfony\Component\Filesystem\Filesystem;
15
16
class ModuleMaker extends Filesystem implements \Saci\Console\Domain\Services\ModuleMaker
17
{
18
19
    /**
20
     * @param Module $module
21
     * @throws \Saci\Console\Domain\Exceptions\ModuleAlreadyExists
22
     */
23
    public function make(Module $module)
24
    {
25
26
        if ($this->exists($module->getPathModule())) {
27
            throw new ModuleAlreadyExists($module->getName());
28
        }
29
30
        $this->mkdir($module->getPaths());
31
    }
32
}