Code Duplication    Length = 14-16 lines in 2 locations

src/Generators/ModuleGenerator.php 1 location

@@ 356-369 (lines=14) @@
353
    /**
354
     * Generate the files.
355
     */
356
    public function generateFiles()
357
    {
358
        foreach ($this->getFiles() as $stub => $file) {
359
            $path = $this->module->getModulePath($this->getName()) . $file;
360
361
            if (!$this->filesystem->isDirectory($dir = dirname($path))) {
362
                $this->filesystem->makeDirectory($dir, 0775, true);
363
            }
364
365
            $this->filesystem->put($path, $this->getStubContents($stub));
366
367
            $this->console->info("Created : {$path}");
368
        }
369
    }
370
371
    /**
372
     * Generate some resources.

src/Generators/DatabaseModuleGenerator.php 1 location

@@ 77-92 (lines=16) @@
74
    /**
75
     * Generate the files.
76
     */
77
    public function generateFiles()
78
    {
79
        foreach ($this->getFiles() as $stub => $file) {
80
            $path = $this->module->getModulePath($this->getName()) . $file;
81
82
            if (!$this->filesystem->isDirectory($dir = dirname($path))) {
83
                $this->filesystem->makeDirectory($dir, 0775, true);
84
            }
85
86
            $this->filesystem->put($path, $this->getStubContents($stub));
87
88
            if (!$this->silentOutput) {
89
                $this->console->info("Created : {$path}");
90
            }
91
        }
92
    }
93
94
    /**
95
     * Generate some resources.