Code Duplication    Length = 8-8 lines in 3 locations

src/Databases/PostgreSql.php 1 location

@@ 107-114 (lines=8) @@
104
        return implode(':', $contents);
105
    }
106
107
    protected function guardAgainstIncompleteCredentials()
108
    {
109
        foreach (['userName', 'dbName', 'host'] as $requiredProperty) {
110
            if (empty($this->$requiredProperty)) {
111
                throw CannotStartDump::emptyParameter($requiredProperty);
112
            }
113
        }
114
    }
115
116
    protected function getEnvironmentVariablesForDumpCommand(string $temporaryCredentialsFile): array
117
    {

src/Databases/MySql.php 1 location

@@ 212-219 (lines=8) @@
209
        return implode(PHP_EOL, $contents);
210
    }
211
212
    protected function guardAgainstIncompleteCredentials()
213
    {
214
        foreach (['userName', 'dbName', 'host'] as $requiredProperty) {
215
            if (strlen($this->$requiredProperty) === 0) {
216
                throw CannotStartDump::emptyParameter($requiredProperty);
217
            }
218
        }
219
    }
220
221
    protected function determineQuote(): string
222
    {

src/Databases/MongoDb.php 1 location

@@ 53-60 (lines=8) @@
50
     * @throws \Spatie\DbDumper\Exceptions\CannotStartDump
51
     * @return void
52
     */
53
    protected function guardAgainstIncompleteCredentials()
54
    {
55
        foreach (['dbName', 'host'] as $requiredProperty) {
56
            if (strlen($this->$requiredProperty) === 0) {
57
                throw CannotStartDump::emptyParameter($requiredProperty);
58
            }
59
        }
60
    }
61
62
    /**
63
     * @param string $collection