Code Duplication    Length = 21-22 lines in 2 locations

src/Commands/MigrateCommand.php 1 location

@@ 37-58 (lines=22) @@
34
     *
35
     * @return mixed
36
     */
37
    public function handle() : int
38
    {
39
        $this->module = $this->laravel['modules'];
40
41
        $name = $this->argument('module');
42
43
        if ($name) {
44
            $module = $this->module->findOrFail($name);
45
46
            $this->migrate($module);
47
48
            return 0;
49
        }
50
51
        foreach ($this->module->getOrdered($this->option('direction')) as $module) {
52
            $this->line('Running for module: <info>' . $module->getName() . '</info>');
53
54
            $this->migrate($module);
55
        }
56
57
        return 0;
58
    }
59
60
    /**
61
     * Run the migration from the specified module.

src/Commands/MigrateStatusCommand.php 1 location

@@ 37-57 (lines=21) @@
34
     *
35
     * @return mixed
36
     */
37
    public function handle() : int
38
    {
39
        $this->module = $this->laravel['modules'];
40
41
        $name = $this->argument('module');
42
43
        if ($name) {
44
            $module = $this->module->findOrFail($name);
45
46
            $this->migrateStatus($module);
47
48
            return 0;
49
        }
50
51
        foreach ($this->module->getOrdered($this->option('direction')) as $module) {
52
            $this->line('Running for module: <info>' . $module->getName() . '</info>');
53
            $this->migrateStatus($module);
54
        }
55
56
        return 0;
57
    }
58
59
    /**
60
     * Run the migration from the specified module.