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

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