Code Duplication    Length = 14-14 lines in 2 locations

src/Distilleries/Contentful/Commands/Sync/SyncFlatten.php 1 location

@@ 27-40 (lines=14) @@
24
     * @param  boolean $isPreview
25
     * @return string
26
     */
27
    protected function dumpSync(bool $isPreview, string $connector = 'mysql'): string
28
    {
29
        $path = storage_path('dumps/' . date('YmdHis') . '_sync' . ($isPreview ? '_preview' : '') . '.sql');
30
        $this->warn('Dump "' . basename($path) . '"...');
31
32
        $dirName = dirname($path);
33
        if (!is_dir($dirName)) {
34
            mkdir($dirName, 0777, true);
35
        }
36
37
        $this->dumpSql($path, $this->getConnector($isPreview, $connector));
38
39
        return realpath($path);
40
    }
41
42
    /**
43
     * Dump SQL database in given file path.

src/Distilleries/Contentful/Commands/Sync/Traits/SyncTrait.php 1 location

@@ 27-40 (lines=14) @@
24
     * @param  boolean  $isPreview
25
     * @return string
26
     */
27
    protected function dumpSync(bool $isPreview, string $connector='mysql'): string
28
    {
29
        $path = storage_path('dumps/' . date('YmdHis') . '_sync' . ($isPreview ? '_preview' : '') . '.sql');
30
        $this->warn('Dump "' . basename($path) . '"...');
31
32
        $dirName = dirname($path);
33
        if (! is_dir($dirName)) {
34
            mkdir($dirName, 0777, true);
35
        }
36
37
        $this->dumpSql($path, $connector);
38
39
        return realpath($path);
40
    }
41
42
    /**
43
     * Dump SQL database in given file path.