Code Duplication    Length = 13-15 lines in 2 locations

src/Components/Database/Installer.php 1 location

@@ 104-118 (lines=15) @@
101
102
        $this->task(
103
            'Updating .gitignore',
104
            function () {
105
                $gitignorePath = base_path('.gitignore');
106
                if (File::exists($gitignorePath)) {
107
                    $contents = File::get($gitignorePath);
108
                    $neededLine = '/database/database.sqlite';
109
                    if (! Str::contains($contents, $neededLine)) {
110
                        File::append($gitignorePath, $neededLine.PHP_EOL);
111
112
                        return true;
113
                    }
114
                }
115
116
                return false;
117
            }
118
        );
119
120
        $this->info('Usage:');
121
        $this->comment(

src/Components/Dotenv/Installer.php 1 location

@@ 62-74 (lines=13) @@
59
            }
60
        );
61
62
        $this->task('Updating .gitignore', function () {
63
            $gitignorePath = base_path('.gitignore');
64
            if (File::exists($gitignorePath)) {
65
                $contents = File::get($gitignorePath);
66
                $neededLine = '.env';
67
                if (! Str::contains($contents, $neededLine)) {
68
                    File::append($gitignorePath, $neededLine.PHP_EOL);
69
70
                    return true;
71
                }
72
            }
73
74
            return false;
75
        });
76
    }
77
}