Code Duplication    Length = 12-15 lines in 3 locations

src/Commands/DumpCommand.php 1 location

@@ 27-38 (lines=12) @@
24
    /**
25
     * Execute the console command.
26
     */
27
    public function handle()
28
    {
29
        $this->info('Generating optimized autoload modules.');
30
31
        if ($module = $this->argument('module')) {
32
            $this->dump($module);
33
        } else {
34
            foreach ($this->laravel['modules']->all() as $module) {
35
                $this->dump($module->getStudlyName());
36
            }
37
        }
38
    }
39
40
    public function dump($module)
41
    {

src/Commands/PublishConfigurationCommand.php 1 location

@@ 28-39 (lines=12) @@
25
    /**
26
     * Execute the console command.
27
     */
28
    public function handle()
29
    {
30
        if ($module = $this->argument('module')) {
31
            $this->publishConfiguration($module);
32
33
            return;
34
        }
35
36
        foreach ($this->laravel['modules']->allEnabled() as $module) {
37
            $this->publishConfiguration($module->getName());
38
        }
39
    }
40
41
    /**
42
     * @param string $module

src/Commands/UpdateCommand.php 1 location

@@ 30-44 (lines=15) @@
27
    /**
28
     * Execute the console command.
29
     */
30
    public function handle()
31
    {
32
        $name = $this->argument('module');
33
34
        if ($name) {
35
            $this->updateModule($name);
36
37
            return;
38
        }
39
40
        /** @var \Nwidart\Modules\Module $module */
41
        foreach ($this->laravel['modules']->getOrdered() as $module) {
42
            $this->updateModule($module->getName());
43
        }
44
    }
45
46
    protected function updateModule($name)
47
    {