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/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
    {

src/Commands/PublishConfigurationCommand.php 1 location

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