Code Duplication    Length = 12-12 lines in 2 locations

src/Command/CreateDatabaseDoctrineCommand.php 1 location

@@ 128-139 (lines=12) @@
125
     *
126
     * @return string
127
     */
128
    private function getDbName(array $params, string $connectionName): string
129
    {
130
        if (isset($params['path'])) {
131
            return $params['path'];
132
        }
133
134
        if (isset($params['dbname'])) {
135
            return $params['dbname'];
136
        }
137
138
        throw new \InvalidArgumentException('Connection does not contain a \'path\' or \'dbname\' parameter.');
139
    }
140
141
    /**
142
     * @param OutputInterface $output

src/Command/DropDatabaseDoctrineCommand.php 1 location

@@ 143-154 (lines=12) @@
140
     *
141
     * @return string
142
     */
143
    private function getDbName(array $params, string $connectionName): string
144
    {
145
        if (isset($params['path'])) {
146
            return $params['path'];
147
        }
148
149
        if (isset($params['dbname'])) {
150
            return $params['dbname'];
151
        }
152
153
        throw new \InvalidArgumentException('Connection does not contain a \'path\' or \'dbname\' parameter.');
154
    }
155
156
    /**
157
     * @param OutputInterface $output