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

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