Code Duplication    Length = 9-12 lines in 2 locations

src/Generators/ModuleGenerator.php 1 location

@@ 292-300 (lines=9) @@
289
    {
290
        $name = $this->getName();
291
292
        if ($this->module->has($name)) {
293
            if ($this->force) {
294
                $this->module->delete($name);
295
            } else {
296
                $this->console->error("Module [{$name}] already exist!");
297
298
                return E_ERROR;
299
            }
300
        }
301
302
        $this->generateFolders();
303

src/Generators/DatabaseModuleGenerator.php 1 location

@@ 33-44 (lines=12) @@
30
    {
31
        $name = $this->getName();
32
33
        if ($this->module->has($name)) {
34
            if ($this->force) {
35
                $this->module->delete($name);
36
            } else {
37
                if (!$this->silentOutput) {
38
                    $this->console->info("Module [{$name}] already exist!");
39
                } else {
40
                    abort(400, "Module [{$name}] already exist!");
41
                }
42
43
                return false;
44
            }
45
        }
46
47
        // Get data from module.json.